Eric Shelhamer
Eric Shelhamer

Reputation: 85

How do I get a developer id for google custom search api?

I have a GAE app , so I selected :

  1. Public Access API
  2. Browser (or should I have selected server)
  3. *.mysite.appspot.com/*, *.googleapis.com/*, http://localhost:8080/*

I make a api call as :

 from lib.googleapiclient.discovery import build
 service = build("customsearch", "v1",developerKey="xxxx")

But I get error as:

"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."

what should I do ?

Upvotes: 1

Views: 207

Answers (1)

Layo
Layo

Reputation: 687

Besides the fact that you indeed should use an API Server Key as Alex indicated, the error message is telling you that the API request is coming from and unauthorized IP/Domain because the IP/Domain hasn't been whitelisted on the API key.

I would set a new Server key up with any IP allowed (no ip/range defined).

Upvotes: 1

Related Questions