Question re Google Ads API v21: generateKeywordHistoricalMetrics fails for recent month (July)

49 views
Skip to first unread message

Chuankun Liang

unread,
Aug 25, 2025, 2:08:08 AM (13 days ago) Aug 25
to Google Ads API and AdWords API Forum

Hello everyone,

I'm using the generateKeywordHistoricalMetrics method from the KeywordPlanIdeaServiceClient in the Google Ads API v21 to retrieve historical keyword metrics.

I've encountered an issue where requests for an older month (e.g., June 2025) succeed, while requests for a more recent month (July 2025) are failing. I'm hoping to get some help and clarification from the community.

Context & Environment:

API Version: v21

Service: KeywordPlanIdeaServiceClient

Method: generateKeywordHistoricalMetrics

Current Date: August 23, 2025

Successful Request Parameters (for June 2025):

code

JSON

{

  "customer_id": "[My Customer ID]",

  "keywords": "silk pillowcase",

  "historical_metrics_options": {

    "year_month_range": {

      "start": {

        "year": 2025,

        "month": "JUNE"

      },

      "end": {

        "year": 2025,

        "month": "JUNE"

      }

    }

  },

  "geo_target_constants": "geoTargetConstants/2840",

  "keyword_plan_network": "GOOGLE_SEARCH"

}

Failing Request Parameters (for July 2025):

code

JSON

{

  "customer_id": "[My Customer ID]",

  "keywords": "silk pillowcase",

  "historical_metrics_options": {

    "year_month_range": {

      "start": {

        "year": 2025,

        "month": "JULY"

      },

      "end": {

        "year": 2025,

        "month": "JULY"

      }

    }

  },

  "geo_target_constants": "geoTargetConstants/2840",

  "keyword_plan_network": "GOOGLE_SEARCH"

}


Error Message:

Request ID reqeust-id failed due to GoogleAdsException. Underlying errors:

  Error 0: error_code {

  keyword_plan_idea_error: INVALID_VALUE

}

message: "The input has an invalid value."



My Analysis & Hypothesis:

My main observation is that the only variable between the successful and failing requests is the year_month_range.

Given that the current date is August 23rd, my hypothesis is that this failure is caused by the historical metrics data for July not being fully processed or available to the API yet. In other words, I suspect this is a data latency issue.

My Questions:

Is my hypothesis correct? Is there any official documentation regarding the data latency for historical metrics? (e.g., after which day of the month is the previous month's data considered stable and available?)

What is the community's best practice for this? Is there a recommended "safe" waiting period before querying the most recent full month's data?

If data latency is not the cause, what other potential issues could lead to this behavior based on the information provided?

Thank you in advance for any help or insights

Google Ads API Forum Advisor

unread,
Aug 25, 2025, 7:50:55 AM (13 days ago) Aug 25
to liang...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

To answer all your queries regarding the latency, could you confirm whether you are able to get the historic metric data for the keyword 'silk pillowcase' in the month 'July' 2025 from the Google Ads account(UI)? If yes, please provide us with the uncropped UI screenshot with a visible customer Id by highlighting the keyword and the date range.

If you are not able to get the data for most recent month i.e, July 2025, then it's possible from the Google Ads API too. Because the API can only return data that's possible/exists in your account only. For more information on historic metric data refer to the Generate Historical Metrics. I hope this helps.

You can send the details via Reply privately to the author option, or direct private reply to this email.
 

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-08-25 11:50:07Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01u53lI:ref" (ADR-00330876)



Reply all
Reply to author
Forward
0 new messages