Question

I am creating a browser extension (Chrome/FF/Safari/Opera) for YouTube using the YouTube api.

The extension gets all of a users videos and searches through each of the videos last comments 1000 comments (because of the api limits this). It then displays comments that match a certain criteria. (That is those that contain links).

I initially had the videos in chunks of 100's but due to getting 403 forbidden quota exceeded responses I reduced this to video 50 which wasn't enough so reduced it again to 25.

I also use a javascript setTimeout between each video to try and spread the api requests. Initially this was 2 seconds but I have steadily increased it until I am now at 7 seconds. This long wait has obviously made my functionality a somewhat tedious experience for users although I am just about there and not getting the 403's anymore.

So my questions are:

Is this to be expected from the api?

What can I do to improve this?

Would a developer key help here (or is it even possible yo use one in an extension)?

In terms of the developer key I have watched a youtube api video which discussed that developer keys will reduce the chance of quota exceeded responses. But I also think that this is not something that can be used in an extension. I am not using my own server or website for my extension.

Was it helpful?

Solution

Yes, if you don't use an API key, you will be bound to IP quotas. Using API/developers keys is the best practice.

There is no reason for you not to use it. You can put it inside your code simply.

You can get your key from here: https://cloud.google.com/console#/project

CORRECTION: URL for YouTube developer key is:

http://code.google.com/apis/youtube/dashboard/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top