5

I try to search using the Youtube API.

but, received this message 'ipRefererBlocked'

https://i.stack.imgur.com/sc0dx.png

The following image is my API settings

https://i.stack.imgur.com/6uBeh.png

please give me the way.

Geeky Guy
  • 9,229
  • 4
  • 42
  • 62
Lemon Knife
  • 53
  • 1
  • 8

1 Answers1

3

There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from P or referer should be allowed. Your request was blocked because it came from an IP address that didn't match the IP restrictions for that key.

That implies you have created a server API key, while what you want is an ios client API key. Make sure you are requesting the YouTube scope as part of sign in as well.

Every request must either specify an API key or provide an OAuth 2.0 token. Your API key is available in the Developer Console's API Access pane for your project.

Here's a related SO ticket, you may use the work around offered by community: Youtube API permission 403 Forbidden error and YouTube Api - Could not search: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden

Community
  • 1
  • 1
Android Enthusiast
  • 4,826
  • 2
  • 15
  • 30
  • Specifically, your 2nd screenshot shows the API key will only accept requests from http://127.0.0.1:59 so check your server. – johnh10 Jul 04 '16 at 20:35