Google Drive API Error Daily Limit for Unauthenticated Use Exceeded
Solution 1
The problem was while getting access token. I was not providing correct scopes. When i changed the scope to
https://spreadsheets.google.com/feeds https://docs.google.com/feeds https://www.googleapis.com/auth/drive.file
it worked fine
Solution 2
I was using NodeJS to download a file, but was forgetting to pass the auth.
Initially I was using:
function downloadFiles() {
const service = google.drive('v3');
const dest = fs.createWriteStream('/tmp/foo.csv');
const fileId = '12345_ID_GOES_HERE';
service.files.export({
fileId: fileId,
mimeType: 'text/csv'
});
}
afterwards, I added an auth
argument to the function, and passed it to the export
method as well:
function downloadFiles(auth) {
const service = google.drive('v3');
const dest = fs.createWriteStream('/tmp/foo.csv');
const fileId = '12345_ID_GOES_HERE';
service.files.export({
auth: auth,
fileId: fileId,
mimeType: 'text/csv'
})
}
I am getting auth
by creating an instance of google-auth-library
Shan Khan
Masters in Machine Learning, currently working in Data Scientist and Experience of more than 7 years in IT dealing with wide range of applications and platforms, experience within multi-tier environments, analysis, design, consultation and teams leading roles. Delivered/ deployed mission critical applications/ solutions for worldwide customers on highly availability productions environments. Expertise: ➢ Machine Learning and Natural Language Processing ➢ Implementing DevOps process inside Team ➢ Micro services and Azure App Service ➢ Worked in Dynamics 365 Integration Product Development ➢ Worked in SAP HCM Module Product Development ➢ System Analysis and Design More Details on my resume available @ Developer Story
Updated on June 04, 2022Comments
-
Shan Khan almost 2 years
Im getting error on using Google API. having right to connect with Google Drive and add new sheet and insert data into it.
It was working till yesterday but when i run the application today. Im getting error :
Error appears after users given token and tried to access the DRIVE API to get all the files
domain: "usageLimits" extendedHelp: "https://code.google.com/apis/console" message: "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup." reason: "dailyLimitExceededUnreg"
I have not changed any settings. Following API are enables for my application access token. Do i have to add / enable more API to make it work.
-
meso_2600 over 6 yearswhere did you define the scope? I have enabled API and I am still hitting same issue
-
ProfNandaa over 6 yearsThis is the correct answer, the issue is with the
auth
object.