question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

googleapiclient.errors.UnknownApiNameOrVersion: name: webmasters version: v3

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:9
  • Comments:26

github_iconTop GitHub Comments

5reactions
paddiecommented, Sep 23, 2020

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.

1reaction
iamsaurabhguptcommented, Sep 23, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - UnknownApiNameOrVersion("name: %s version: %s ...
The log shows error originating from webmasters build function mentioned below. from googleapiclient.discovery import build import requests from ...
Read more >
Google Search Console API issue
googleapiclient.errors.UnknownApiNameOrVersion: name: webmasters version: v3. The error happens on this line of code:.
Read more >
discovery.py - Google Git
from googleapiclient.errors import UnknownApiNameOrVersion. from googleapiclient.errors import ... version are the names from the Discovery service.
Read more >
Source Code for Module googleapiclient.discovery
_helpers import _add_query_parameter 81 from googleapiclient. ... The serviceName and 200 version are the names from the Discovery service.
Read more >
Googleapiclient.Errors.Unknownapinameorversion: Name
google/googleapipythonclient Google API Client This is the Python client library ... UnknownApiNameOrVersion: name: webmasters version: v3 build'webmasters' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found