I have a daily Python script that pulls data from the Google Ads API. I had the v20.0.0 of the google ads library installed. On October 28, it started failing with this error:

Error with message " Version v2 is deprecated. Requests to this version will be blocked." 

I assume this is because of this setup line:

ga_service = client.get_service('GoogleAdsService', version='v2') 

But when I change that to v3 (just a guess, since the error message doesn't tell me what versions are accepted), I get this when I run the script:

ValueError: Specified Google Ads API version "v3" does not exist. Valid API versions are: "v2", "v1" 

I ran pip install --upgrade googleads, which got me up to v25.0.0, but still got the same errors. I then uninstalled and re-installed googleads, but still get the same errors.

I haven't been able to find a migration guide in Google's documentation. Does anyone know how to update the package and script to get it running again?

Tag:google-ads-api, google-api, python-3.x

Only one comment.

  1. James Waring

    My guess is that the old Api you are using google says it still works but, by the looks of it they have integrated the new api into it. I am assuming this because they ended support of v2 of the new api on October 21, 2020 which coincides with your error.

    I would look at upgrading to the new api over trying to update what v2 code they have used as v3 is also ending soon and v6 has just been released. I have had some errors from v4 to v5 so it will be easier to just do the upgrade.

    Good luck as its not just an update they have changed a fair amount from the older version.

Add a new comment.