3
  1. I'm using the youtube-analytics sample: https://developers.google.com/youtube/analytics/v1/code_samples/javascript#retrieve_daily_channel_statistics;

  2. At the creation of Client ID, I put the localhost:5500 on authorized Javascript origins

  3. I confirmed my ID in the code sample, and I started the application with the addon "Live Server" of Visual Studio Code. When the HTML file goes online I got the following error:

**

"Not a valid origin for the client: http://localhost:5500 has not been whitelisted for client ID 716813497294-baiq0eod8uesrfpdf74hgibvvp2e58u3.apps.googleusercontent.com. Please go to https://console.developers.google.com/ and whitelist this origin for your project's client ID."

**

  1. I think the problem it's still at the way I use localhost with a port to request data from API, I wanted to know If I must use a hosted server to proceed? Because the google don't permit ports on autorizhed domains in credencials

enter image description here

It says that: the links of my apps must be hosted in authorized domain. What that mean?

Someone know how can I configure my localhost to retrieve the yt analytics data api?

I tried google and similar problems in stackoverflow and I found this post:

Google API: Not a valid origin for the client: url has not been whitelisted for client ID "ID"

but my problem is nearly different but I can't solved with the answers it has.

Juliano Silva
  • 288
  • 1
  • 10

1 Answers1

0

Have you tried to setup only localhost without giving the port and the protocol? The error in your screen is clear, it tell you that you can't specify the port and the protocol for the domain to authorize.

see the docs about the localhost setup, it's in the point 6. but I'm not sure that this is the same API you wanna use.

jihuuNI
  • 551
  • 2
  • 5
  • 17