hgdrive
hgdrive

Reputation: 11

Google Search Console API: HttpError 403

I am trying to get data from GSC Search Analytics API using Python. I have been following this guide, but no matter how many times I tried to change something I keep getting this error:

 raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://www.googleapis.com/webmasters/v3/sites/http%3A%2F%2Fwww.example.com/searchAnalytics/query?alt=json returned "User does not have sufficient permission for
site 'http://www.example.com/'. See also: https://support.google.co
m/webmasters/answer/2451999.">

I gave full permission to the email address generated in for the service account in Google developers console user permission screenshot

I do get Google Analytics report retrieved with all the data, but google search console report is empty due to this permission issue.

What am I doing wrong?

Upvotes: 1

Views: 2238

Answers (1)

Sajjad Mortazavi
Sajjad Mortazavi

Reputation: 310

For those who do not know, as it is said here, passing your website URL in your query matters.

The URL of the property to add. Examples: http://www.example.com/ (for a URL-prefix property) or sc-domain:example.com (for a Domain property)

Upvotes: 2

Related Questions