How to specify operations parameter in SearchVolumeSearchParameter for Google Ads API keyword volume data?

I’m working with the Google Ads API to retrieve keyword volume metrics but I’m stuck on a specific parameter. When I use SearchVolumeSearchParameter, it needs an operations field but the docs don’t clearly explain what values are valid here. My goal is to get keyword data with monthly search volumes.

ads_client = adwords.AdWordsClient.LoadFromStorage()
idea_service = ads_client.GetService(
    'TargetingIdeaService', version='v201809')

request_config = {
    'ideaType': 'KEYWORD',
    'requestType': 'STATS'
}

request_config['requestedAttributeTypes'] = [
    'KEYWORD_TEXT',
    'SEARCH_VOLUME'
]

start_index = 0
RESULTS_PER_PAGE = 500
request_config['paging'] = {
    'startIndex': str(start_index),
    'numberResults': str(RESULTS_PER_PAGE)
}

request_config['searchParameters'] = [{
    'xsi_type': 'SearchVolumeSearchParameter',
    'operation': []
}]

result_page = idea_service.get(request_config)

What should I put in the operation array to make this work properly?

The operation parameter takes an array of DoubleComparisonOperation objects for search volume filtering. Each object needs an operator field (GREATER_THAN, LESS_THAN, GREATER_THAN_OR_EQUAL_TO) and an operand with a microAmount value. To filter keywords with at least 1000 monthly searches: [{'operator': 'GREATER_THAN_OR_EQUAL_TO', 'operand': {'microAmount': 1000}}]. I hit the same issues with this API last year - the documentation is terrible. The v201809 version you’re using was sunset in 2019, which explains why the docs suck. Switch to the current Google Ads API instead. It’s way easier for keyword volume data and actually has decent documentation with working examples.

Your code’s using the old AdWords API (v201809) - that’s been deprecated, which explains why you can’t find decent docs. The operation parameter in SearchVolumeSearchParameter needs an array of DoubleComparisonOperation objects for min/max search volume thresholds. Try something like {'operator': 'GREATER_THAN_OR_EQUAL_TO', 'operand': {'microAmount': 1000}} for minimum volume. But honestly? Don’t bother fixing this legacy code. Just migrate to Google Ads API v14. Way better documentation, and it uses KeywordPlanIdeaService for keyword planning. The old API’s getting killed off soon anyway, so you’ll have to update regardless.

hey, you’re on an outdated version of the AdWords API – they ditched it ages ago. for the operation field, yeah, you need DoubleComparisonOperation objects, but honestly, just switch to the new Google Ads API. it’s way better and the keyword planner actually functions well.