1
votes

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 ?

1
You should indeed select server -- that's the type of your application (a GAE web server) for which you need to obtain the desired developer key.Alex Martelli

1 Answers

1
votes

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