What endpoint should I make calls to to get search volume for a particular set of keywords?

43 views
Skip to first unread message

Leor Fishman

unread,
Jul 1, 2019, 11:07:02 AM7/1/19
to AdWords API and Google Ads API Forum
I've been trying to read the docs and the relevant code examples seem to be doing stuff that's way more sophisticated than what I need -- seems like I need to be accessing https://developers.google.com/google-ads/api/reference/rpc/google.ads.googleads.v1.common#google.ads.googleads.v1.common.KeywordPlanHistoricalMetrics somehow?  But I'm not sure how to access that via the python client libs (or via direct curl requests, I'm ok using either).  This seems like a pretty basic question, so I might well have missed an explanation/similar q in the forums or on the docs.
Thanks in advance!

Google Ads API Forum Advisor Prod

unread,
Jul 2, 2019, 7:01:32 PM7/2/19
to adwor...@googlegroups.com
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
Reply all
Reply to author
Forward
0 new messages