Search code examples
google-apigoogle-oauthyoutube-data-apigoogle-api-nodejs-client

YouTube API v3 nodejs quickstart not working


https://developers.google.com/youtube/v3/quickstart/nodejs?hl=en_US

after running the code I get the url below:

Authorize this app by visiting this url: https://accounts.google.com/o/oauth2/v2/auth?access...
Enter the code from that page here:

But after signing in I was brought to this link with no code.

http://localhost/?code=4/0ARtbsJoy4Qoio0JdBeaPpTAnuvJn9gKarNnLzF3cpK_RQ7DgP_oO-Q1QPpfOS5OO6JYgWw&scope=https://www.googleapis.com/auth/youtube.readonly


Solution

  • In your example the code you have to provide is just:

    4/0ARtbsJoy4Qoio0JdBeaPpTAnuvJn9gKarNnLzF3cpK_RQ7DgP_oO-Q1QPpfOS5OO6JYgWw
    

    (deduced from the URL you provided).