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 Team |
[2025-08-25 11:50:07Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01u53lI:ref" (ADR-00330876)