YouTube Data API request on Firebase Web

Trying to search YouTube with its Data API for videos based on keywords from my website.

The gapi.load is working perfectly when the DOM loads. However even after enabling the YouTube Data API in the console, I receive the 403 error upon requesting. Following is the object with parameters -

"part": 'snippet',
        "type": 'video',
        "order": 'relevance',
        "maxResults": 3,
        "q": term

..which are displaying correctly in the console.

Any suggestions? The error object is given below -

[{…}, "{↵ "error": {↵ "errors": [↵ {↵ "domain": "us…ion to propagate to our systems and retry."↵ }↵}↵", {…}, 403, null] 0: {error: {…}} 1: "{↵ "error": {↵ "errors": [↵ {↵ "domain": "usageLimits",↵ "reason": "accessNotConfigured",↵ "message": "Access Not Configured. YouTube Data API has not been used in project 456406544320 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=456406544320 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",↵
"extendedHelp": "https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=456406544320"↵ }↵ ],↵ "code": 403,↵ "message": "Access Not Configured. YouTube Data API has not been used in project 456406544320 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=456406544320 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."↵ }↵}↵" 2: {cache-control: "private, max-age=0", content-encoding: "gzip", content-length: "359", content-type: "application/json; charset=UTF-8", date: "Thu, 14 Nov 2019 01:29:24 GMT", …} 3: 403 4: null length: 5 proto: Array(0)

1 answer

  • answered 2019-11-14 07:24 DaImTo

    YouTube Data API has not been used in project 456406544320 before or it is disabled.

    The error message itself tells you what theproblem is. You havent enabled the youtube api in your project on Google Developer console.

    Go to google developer console for that project and enable the youtube data api.