Hello Leor,
To get the KeywordPlanKeywordHistoricalMetrics via Google Ads API you can use
the keyword_plan_service.GenerateHistoricalMetrics method for which you can use
the code sample shown here and update the line 36 with
generate_historical_metrics instead as shown below.
changed line 36:
response = keyword_plan_service.generate_historical_metrics(resource_name)
Below is my request and response for your reference:
[2019-07-02 14:58:11 - DEBUG] Request
-------
Method:
/google.ads.googleads.v1.services.KeywordPlanService/GenerateHistoricalMetrics
Host: googleads.googleapis.com:443
Headers: {
"developer-token": "REDACTED",
"x-goog-api-client": "gl-python/3.6.5 grpc/1.21.1 gax/1.11.1 gapic/2.2.0"
}
Request: keyword_plan: "customers/8760527478/keywordPlans/77189290"
Response
-------
Headers: {
"content-disposition": "attachment",
"request-id": "DjGM6hKq5Vcd2eB_1xowdQ"
}
Response: metrics {
search_query {
value: "insektenschutz"
}
keyword_metrics {
avg_monthly_searches {
value: 50
}
competition: LOW
}
}
Please let me know if you have any further questions.
Regards,
Sai Teja, Google Ads API Team
ref:_00D1U1174p._5001UCaNOK:ref
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/xhICV000000000000000000000000000000000000000000000PU13HX00a7C-o1dRQFOnDbb7uURO6Q%40sfdc.net.