Abhinavxp
Abhinavxp

Reputation: 71

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

I am using Python version 3.7.7, Trying to run to code for 'ads_service.search'. That gave me the error that 'Specified Google Ads API version "v3" does not exist'

import argparse
import sys


import google.ads.google_ads.client


ADS_PAGE_SIZE = 1000

def main(client, customer_id):
  ads_service = client.get_service('GoogleAdsService', version='v3')
  query = ('SELECT change_status.resource_name, '
           'change_status.last_change_date_time, '
           'change_status.resource_type, '
           'change_status.campaign, '
           'change_status.ad_group, '
           'change_status.resource_status, '
           'change_status.ad_group_ad, '
           'change_status.ad_group_criterion, '
           'change_status.campaign_criterion '
           'FROM change_status '
           'WHERE change_status.last_change_date_time DURING YESTERDAY '
           'ORDER BY change_status.last_change_date_time')

  response = ads_service.search(customer_id, query=query,
                                page_size=ADS_PAGE_SIZE)

Upvotes: 4

Views: 1201

Answers (1)

Abhinavxp
Abhinavxp

Reputation: 71

The issue is occurring because of some module missing when you install using the command:

pip install google-ads

uninstall the package and reinstall it.

pip uninstall google-ads
pip3 install google-ads

Upvotes: 3

Related Questions