Google-api-python-client: googleapiclient.errors.UnknownApiNameOrVersion: name: webmasters version: v3

Created on 23 Sep 2020  Â·  25Comments  Â·  Source: googleapis/google-api-python-client

OS macOS: 10.15.4
Python version: python 3.8.1
pip version: pip 19.0.3
google-api-python-client version: 1.12.1

Code example
from googleapiclient.discovery import build
build('webmasters', "v3", developerKey="developer_key")
Stack trace
googleapiclient.errors.UnknownApiNameOrVersion: name: webmasters version: v3

Hi Team,

While trying to get data from Search Console API and get this error UnknownApiNameOrVersion.
I tried the discovery API and it showed the the discoveryRestUrl as
https://www.googleapis.com/discovery/v1/apis/webmasters/v3/rest
image
But, the same url on web is down:
image
Please rectify immediately.
All our reports are breaking.

Most helpful comment

Google said here already https://webmasters.googleblog.com/2020/08/search-console-api-announcements.html that they would change the API. However, they have set the date as 31 Dec.

_"If you’re querying the Search Console API using an external API library, or querying the Webmasters API discovery document directly you will need to take action as we’ll drop the support in the Webmasters discovery document. Our current plan is to support it until December 31, 2020 - but we’ll provide more details and guidance in the coming months."_

So, I'm not really seeing, from this article _which_ actions are actually required, but updating the build step to use discovery.build('searchconsole', 'v1') instead of the old discovery.build('webmasters', 'v3') resolved the issue for me, and also seems to be actually using the old webmasters/v3 endpoint with the rest document:

https://www.googleapis.com/discovery/v1/apis/searchconsole/v1/rest

    "sites": {
      "methods": {
        "list": {
          "scopes": [
            "https://www.googleapis.com/auth/webmasters",
            "https://www.googleapis.com/auth/webmasters.readonly"
          ],
          "id": "webmasters.sites.list",
          "parameterOrder": [],
          "path": "webmasters/v3/sites",
          "description": " Lists the user's Search Console sites.",
          "httpMethod": "GET",
          "flatPath": "webmasters/v3/sites",
          "response": {
            "$ref": "SitesListResponse"
          },
          "parameters": {}
        },

working off of that assumption now at least.

All 25 comments

I have the same issue with the api
raise UnknownApiNameOrVersion(“name: %s version: %s” % (serviceName, version)) googleapiclient.errors.UnknownApiNameOrVersion: name: webmasters version: v3

It worked fine yesterday, but this morning the issue has came

same issue for me, started three hours ago

We are experiencing the same issue as well

We have the same issue.

We are also running into this issue

we are seeing this too,
using reqbin you can check its an issue from both US, DE and us in DK

https://reqbin.com/c-4rgtzhsk

curl 'https://www.googleapis.com/webmasters/v3/'

gives 404

related issues:

@busunkim96 have you heard anything?

somebody tweet about it, crossing fingers for fast solution

https://twitter.com/davidiwanow/status/1308675174003245057

and

https://twitter.com/SimoAhava/status/1308628065296281601

Same issue for me, 1 hour ago. https://www.googleapis.com/discovery/v1/apis/webmasters/v3/rest is returning 404 from EU

We are seeing the same issue, since 2 in the morning and as recent as 10 minutes ago, from europe-west1

I'm also running into this issue. Data pipelines started at 2 in the morning. All were running into this problem.
Tried localy, and it was working for 5 minutes. Now it's broken again.

Same here. Started some time within 24 hours.

this issue is region related. https://webmasters.googleapis.com/$discovery/rest?version=v3 is reachable from US, but not in major EU.

a very unscientific test involving https://proxy-ams.hidemyass-freeproxy.com/ showed the following http responses based on different locations (right now)

NY: 404
seattle: 200
frankfurt: 200
amsterdam: 404
praque: 200

edit hi @paddie 🤗

edit 2

"maybe if we try again and again the 404/200 is actually morse code from a sys-admin locked in a closet somewhere lulz"
... some speculation in a đź§µ somewhere :trollface:

edit hi @paddie 🤗

hello darling @sloev - what are you doing here?

grocery shopping some sweet lookin' data but google wont give it to me after i paid for it :trollface:
....and firing off mischievous jokes of course ;-)

grocery shopping some sweet lookin' data but google wont give it to me after i paid for it :trollface:
....and firing off mischievous jokes of course ;-)

Doing god's work here bud :)

It seems that discovery.build('searchconsole', 'v1') is working. Can somebody verify that?
According to the documentation this is only the beta endpoint for the url testing tool
https://developers.google.com/webmaster-tools/search-console-api/reference/rest

It seems that discovery.build('searchconsole', 'v1') is working. Can somebody verify that?
According to the documentation this is only the beta endpoint for the url testing tool
https://developers.google.com/webmaster-tools/search-console-api/reference/rest

I just tried that and it seems to work, but not sure if this is the one to use

Google said here already https://webmasters.googleblog.com/2020/08/search-console-api-announcements.html that they would change the API. However, they have set the date as 31 Dec.

_"If you’re querying the Search Console API using an external API library, or querying the Webmasters API discovery document directly you will need to take action as we’ll drop the support in the Webmasters discovery document. Our current plan is to support it until December 31, 2020 - but we’ll provide more details and guidance in the coming months."_

It works properly again in SEA, but I am not sure if it will collapse again or not

This issue seem to be resolved now.

Not for me

Google said here already https://webmasters.googleblog.com/2020/08/search-console-api-announcements.html that they would change the API. However, they have set the date as 31 Dec.

_"If you’re querying the Search Console API using an external API library, or querying the Webmasters API discovery document directly you will need to take action as we’ll drop the support in the Webmasters discovery document. Our current plan is to support it until December 31, 2020 - but we’ll provide more details and guidance in the coming months."_

So, I'm not really seeing, from this article _which_ actions are actually required, but updating the build step to use discovery.build('searchconsole', 'v1') instead of the old discovery.build('webmasters', 'v3') resolved the issue for me, and also seems to be actually using the old webmasters/v3 endpoint with the rest document:

https://www.googleapis.com/discovery/v1/apis/searchconsole/v1/rest

    "sites": {
      "methods": {
        "list": {
          "scopes": [
            "https://www.googleapis.com/auth/webmasters",
            "https://www.googleapis.com/auth/webmasters.readonly"
          ],
          "id": "webmasters.sites.list",
          "parameterOrder": [],
          "path": "webmasters/v3/sites",
          "description": " Lists the user's Search Console sites.",
          "httpMethod": "GET",
          "flatPath": "webmasters/v3/sites",
          "response": {
            "$ref": "SitesListResponse"
          },
          "parameters": {}
        },

working off of that assumption now at least.

both webmasters/v3 and searchconsole/v1 are working now.
Seems better to shift to searchconsole/v1 for future consistency.
Closing this now.

Was this page helpful?
0 / 5 - 0 ratings