Tarak
Tarak

Reputation: 41

pageSpeedOnline.pagespeedapi().runpagespeed(..) function fails with error 403

I have tried to analyze url page using pageSpeedOnline.pagespeedapi().runpagespeed(..) api but fails with 403 "Forbidden". The api is enabled in the console and the billing is also enabled but I am blocked further since it always fails with 403. The billing was just enabled since a week back.

Below is the response of the curl request, curl "https://www.googleapis.com/pagespeedonline/v1/runPagespeed?url=http://code.google.com/speed/page-speed/&key=API_KEY"

{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "accessNotConfigured",
    "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
   }
  ],
  "code": 403,
  "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
 }
}

Please help.

Upvotes: 0

Views: 611

Answers (1)

Tarak
Tarak

Reputation: 41

I got it resolved, by creating "Key for browser apps (with referers)" and used that API key in the project.

Upvotes: 1

Related Questions