2

The following python script has been running as a cloud function on GCP, server us-central1 and has recently began to throw UnknownApiNameOrVersion error. The log shows error originating from webmasters build function mentioned below.

from googleapiclient.discovery import build
import requests
from datetime import datetime
import json
import pandas as pd
from google.cloud import bigquery
from google.cloud import secretmanager
import json

client = secretmanager.SecretManagerServiceClient()
secret = client.access_secret_version('...')

secret = json.loads(secret.payload.data.decode('UTF-8'))
credentials = service_account.Credentials.from_service_account_info(secret, scopes=SCOPES)
webmaster = build(
    'webmasters',
    'v3',
    credentials=credentials
)

1 Answers1

2

Late answer, but due to API changes you should make changes to your code:

  • change webmasters to searchconsole
  • change v3 to v1

More info here

dreamca4er
  • 381
  • 3
  • 14