currency code through API

108 views
Skip to first unread message

Harshad GoogleAds

unread,
Sep 27, 2020, 8:36:40 AM9/27/20
to AdWords API and Google Ads API Forum

I want get currency code for child account under my manager account. 

- I am using the following query 

query_currency = """
    SELECT
     currency_constant.code
    FROM currency_constant
    """

- and parsing the data in the data frame

act_ids=['xxxxxxxxxx','yyyyyyyyyy']
for act_id in act_ids:
    response = ga_service.search_stream(act_id, query_currency)
    for batch in response:
        for row in batch.results:
            currency = row.currency_constant
            dic_currency["Currency_code"].append(currency.code)
df_currency=pd.DataFrame(dic_currency)

- I am getting following output

df_currency.Currency_code.unique()
Out[31]:
array(['AED', 'AOA', 'ARS', 'AUD', 'BDT', 'BGN', 'BHD', 'BND', 'BOB', 'BRL', 'BSD', 'BWP', 'BYN', 'CAD', 'CDF', 'CHF', 'CLP', 'CNY', 'COP', 'CRC', 'CSD', 'CZK', 'DEM', 'DKK', 'DOP', 'DZD', 'EEK', 'EGP', 'ETB', 'EUR', 'FJD', 'FRF', 'GBP', 'GEL', 'GHS', 'GTQ', 'HKD', 'HRK', 'HUF', 'IDR', 'ILS', 'INR', 'JOD', 'JPY', 'KES', 'KHR', 'KRW', 'KWD', 'KZT', 'LBP', 'LKR', 'LTL', 'MAD', 'MGA', 'MMK', 'MTL', 'MUR', 'MWK', 'MXN', 'MYR', 'MZN', 'NAD', 'NGN', 'NIO', 'NOK', 'NPR', 'NZD', 'OMR', 'PAB', 'PEN', 'PHP', 'PKR', 'PLN', 'PYG', 'QAR', 'ROL', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SEK', 'SGD', 'SIT', 'SKK', 'SVC', 'THB', 'TND', 'TRL', 'TRY', 'TWD', 'TZS', 'UAH', 'UGX', 'USD', 'UYU', 'UZS', 'VEB', 'VEF', 'VES', 'VND', 'XAF', 'XOF', 'ZAR', 'ZMW'], dtype=object)

I was expecting the currency code of the particular account in the loop not all. What be done here?

Ideally, I want the currency code to be displayed alongside the metrics ( i.e. cost). What can be done here?

Google Ads API Forum Advisor Prod

unread,
Sep 28, 2020, 2:57:35 PM9/28/20
to harshad...@gmail.com, adwor...@googlegroups.com
Hi Harshad,

Thank you for reaching out to us. I see that you're having issues getting the currency code from your reports. Could you provide us with the request and response log for where you encounter this issue? For privacy, you can respond using "reply privately to author".

As for your question on having the currency code listed in the reports, unfortunately all reports of currency are in micros, and not the currency connected to your Google Ads Account. You can read more about money reports here.

Thank you,

Google Logo
Bryan Li
Google Ads API Team
 


ref:_00D1U1174p._5004Q25XFPX:ref

Harshad GoogleAds

unread,
Sep 29, 2020, 4:42:19 AM9/29/20
to AdWords API and Google Ads API Forum
can you share the steps to collect the logs

Google Ads API Forum Advisor Prod

unread,
Sep 29, 2020, 1:20:29 PM9/29/20
to harshad...@gmail.com, adwor...@googlegroups.com
Hi Harshad,

The steps to logging are listed here. Let me know if you have further questions.

Mat

unread,
Sep 30, 2020, 2:05:39 AM9/30/20
to AdWords API and Google Ads API Forum
Hi Hashard,

you'll get the currency code from "customer" by fetching the customer.currency_code field:
https://developers.google.com/google-ads/api/fields/v5/customer#customer.currency_code

Regards
Mat

Reply all
Reply to author
Forward
0 new messages