Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

Why Does NOT YouTube Data API Work Locally?

$
0
0

I spent countless hours on this error but couldn't figure it out. I'm using the YouTube API to retrieve videos based on a search query. In the browser, when I search for localhost:3000/yt, it shows this message:enter image description here

The server-side code is shown below:

    app.get('/yt', async (req, res) => {    const auth = await authenticate({    keyfilePath: "/Users/hendy/Desktop/Dev/HCI-Summer-Research/EduRec/system/oauth2.keys.json",    scopes: ['https://www.googleapis.com/auth/youtube']  });     google.options({auth});  const result = await youtube.search.list({    part: 'snippet',    q: 'Node.js on Google Cloud',  });  res.send(result.data);})  app.listen(3000);

The OAuth setup from Google Console is shown below. The JSON file that contains this info and my secret and client ID keys is in my project folder.

enter image description here

And this is the API setup:

enter image description here


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>