kj tolentino
kj tolentino

Reputation: 571

Youtube API permission 403 Forbidden error

I'm following the tutorial on this page but I keep getting a 403 Forbidden error when I run the app and try to do a search.

I enabled Youtube Data API v3 on the https://console.developers.google.com/ page and I created an Android API key.

Any suggestions? Thank you.

Could not search: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
"code" : 403,
"errors" : [ {
"domain" : "usageLimits",
"message" : "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 this IP or referer should be allowed.",
"reason" : "ipRefererBlocked",
"extendedHelp" : "https://console.developers.google.com"
} ],
"message" : "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 this IP or referer should be allowed."
}

Upvotes: 21

Views: 14337

Answers (5)

wuijin
wuijin

Reputation: 47

For anyone who finds this that couldn't solve it with the answers above, my problem was the way I entered the domain into the API restriction. I had put *.example.com/*, but my requests were coming from https://example.com. When I removed the *. at the beginning, my requests began working.

Upvotes: 0

Silviu St
Silviu St

Reputation: 1842

Used this for iOS app and received same error so I removed bundle identifier and it worked

Upvotes: 2

Rob Fenwick
Rob Fenwick

Reputation: 169

I had the same problem and after a lot of wasted time my hosting service figured out the API request was being generated by a different IP address than the one associated with my website.

Upvotes: 1

MK_iOS
MK_iOS

Reputation: 388

I have resolved the problem by creating a Server key instead of an iOS key

Upvotes: 1

kj tolentino
kj tolentino

Reputation: 571

I have resolved the problem by creating a Browser key instead of an android key. The browser key needs to have no entry so that it'll say "all refered allowed"

Upvotes: 36

Related Questions