+2 votes
in Web & Google by (3.7k points)

I use youtube data api to get videos for my website. Today, I tried to fetch the videos and got the following error:

An client error occurred: Error calling GET https://www.googleapis.com/youtube/v3/search?part=id%2Csnippet&q=hindi+movie&maxResults=50&key=AIzaSyBookf3-cJ5UjXx-2qeYh9IhpqsdsDFHHJs12: (400) Bad Request

How can I fix it? Did google block my ip?

1 Answer

0 votes
by (11k points)
If you look at google's description for this problem, it says - " It indicates that the query was invalid. E.g., parent ID was missing or the combination of dimensions or metrics requested was not valid." The fix for this error is : You need to make changes to the API query in order for it to work. It means your developer key has either expired or reached the max limits.

Go to https://developers.google.com/maps/documentation/javascript/get-api-key and generate a new key and use the new key. It will fix the problem.