Re: How to convert Google-Ads API GoogleAdsRow to json?

2021-05-18 Thread rahul...@decision-tree.com
I have found a working solution. This will go something like this: ``` import proto response = ga_service.search_stream(search_request) for batch in response: for row in batch.results: logging.debug(proto.Message.to_dict(row)) ``` On Tuesday, September 8, 2020 at 6:33:16

Re: How to convert Google-Ads API GoogleAdsRow to json?

2020-09-08 Thread kol...@exito.de
We are using the Python client library because we don't want to write all the basic stuff. In the meantime I found out how you can directly convert the API result to a pandas dataframe in Python: from pandas import json_normalize from google.protobuf.json_format import MessageToJson ...

Re: How to convert Google-Ads API GoogleAdsRow to json?

2020-07-22 Thread Michael Birk
Hi Rahul, I was able to use this Python library to convert the Ads API v3 responses to JSON: https://github.com/tigrus/protobuf-to-dict mcb On Tuesday, June 11, 2019 at 3:54:07 AM UTC-7 rahul...@gmail.com wrote: > Hi Sai, > > I think Alexander is asking about the SDK. I am also facing the

RE: How to convert Google-Ads API GoogleAdsRow to json?

2020-07-20 Thread Google Ads API Forum Advisor Prod
Hi Thomas, Thank you for reaching out. I just want to confirm that you're following this example when making the cURL request to get the JSON response. If so, please share your client customer ID, cURL request, and any additional error details via Reply privately to author so I can further

Re: How to convert Google-Ads API GoogleAdsRow to json?

2020-07-17 Thread Thomas Koller
Unfortunately doesn't work in Ads API v4 (beta): TypeError: Object of type GoogleAdsRow is not JSON serializable Am Dienstag, 3. Dezember 2019 16:14:26 UTC+1 schrieb Mark Edmondson: > > I couldn't get the protobuf to work but using the SOAP seralizer zeep this > seems to work: >

RE: How to convert Google-Ads API GoogleAdsRow to json?

2019-12-04 Thread Google Ads API Forum Advisor Prod
Hello, Thank you for reaching out. If you are using the our client libraries, it is not possible to retrieve the data in JSON format. However, as an alternative you can use the cURL operation to get the output in JSON format. You can refer to this guide for more details on how to interact with

Re: How to convert Google-Ads API GoogleAdsRow to json?

2019-12-03 Thread Mark Edmondson
I couldn't get the protobuf to work but using the SOAP seralizer zeep this seems to work: https://python-zeep.readthedocs.io/en/latest/helpers.html from zeep import helpers def toJSON(x): input_dict = helpers.serialize_object(x) return json.dumps(input_dict) On Monday, April 1, 2019

Re: How to convert Google-Ads API GoogleAdsRow to json?

2019-06-12 Thread 'UK Analytics' via AdWords API and Google Ads API Forum
You need to use the Google protobuf library: https://developers.google.com/protocol-buffers/docs/reference/python/ from google.protobuf import json_format ### code to get the object ### rec_obj = row.recommendation.text_ad_recommendation.ad json_str = json_format.MessageToJson(rec_obj)

RE: How to convert Google-Ads API GoogleAdsRow to json?

2019-06-11 Thread Google Ads API Forum Advisor Prod
Hello Rahul, We don't have such functionality to get JSON format directly via GoogleAdsRow. Hence, I provided the CURL operation which will give JSON as output. I recommend you to post your concern on the client library issue tracker , Our client library owners are better equipped to answer

Re: How to convert Google-Ads API GoogleAdsRow to json?

2019-06-11 Thread Rahul Kumar
Hi Sai, I think Alexander is asking about the SDK. I am also facing the same problem. If someone is using the python SDK for google ads API, how can one convert the GoogleAdsRow to json. I have tried to use a CustomEncoder by subclassing the json.JSONEncoder, but that is not the correct way as

RE: How to convert Google-Ads API GoogleAdsRow to json?

2019-04-01 Thread googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
Hello Alexander, You can refer this APi call example mentioned here , which will give the response in JSON format, when you make API call using CURL operations. For example you could try the below CURL

How to convert Google-Ads API GoogleAdsRow to json?

2019-04-01 Thread Alexander Belozerov
Hello there, Im querying google ads api and need to save results as json. What is the best way to convert GoogleAdsRow type into json? The result of the google ads api call is GoogleAdsRow that looks like this: campaign { resource_name: "customers/321/campaigns/123" id { value: 123 }