selector = {
'ideaType': 'KEYWORD',
'requestType': 'IDEAS'
}
selector['requestedAttributeTypes'] = [
'KEYWORD_TEXT', 'SEARCH_VOLUME'
]
selector['searchParameters'].append({
'xsi_type': 'CategoryProductsAndServicesSearchParameter',
'categoryId': category_id
})
# Targeting - Language
# https://developers.google.com/adwords/api/docs/appendix/codes-formats#languages
selector['searchParameters'].append({
'xsi_type': 'LanguageSearchParameter',
'languages': [{'id':language_id}]
})
# Targeting - Location
# https://developers.google.com/adwords/api/docs/appendix/geotargeting
selector['searchParameters'].append({
'xsi_type': 'LocationSearchParameter',
'locations': [{'id':location_id}]
})
# Targeting - Network
selector['searchParameters'].append({
'xsi_type': 'NetworkSearchParameter',
'networkSetting': {
'targetGoogleSearch': True,
'targetSearchNetwork': False,
'targetContentNetwork': False,
'targetPartnerSearchNetwork': False
}
})
if len(include_keywords)>0 and len(exclude_keywords)>0:
selector['searchParameters'].append({
'xsi_type': 'IdeaTextFilterSearchParameter',
'included': include_keywords,
'excluded': exclude_keywords
})
elif len(include_keywords)>0:
selector['searchParameters'].append({
'xsi_type': 'IdeaTextFilterSearchParameter',
'included': include_keywords
})
elif len(exclude_keywords)>0:
selector['searchParameters'].append({
'xsi_type': 'IdeaTextFilterSearchParameter',
'excluded': exclude_keywords
})
# Initialize appropriate service.
targeting_idea_service = client.GetService(
'TargetingIdeaService', version='v201809'
)
![]() | ![]() | ![]() |
Kluczowe czynniki rankingowe Google w e-commerce. Poznaj wyniki analizy SEO
Hi Dariusz,
Thank you for reaching support. Please find my response to your queries below.
Can I replicate behavior of Adwords API (listed above) with Google Ads API? So far I managed to decode point 2 and 4 but only with "include keywords": The negative keywords can be added to Keyword Plan using mutate method in KeywordPlanNegativeKeywordsService. The Search parameter for the Keyword Idea types is not available in Google Ads API. You could refer to the migration guide in future for the equivalent services in Google Ads API. Also, find below the services in Ads API to achieve the following:
Get traffic volume for input keywords (in batches of 700): You could use KeywordPlanService.GenerateForecastMetrics to get the traffic volume for input keywords in Google Ads API.
Get keyword ideas based on seed. I have option to include and exclude keywords: You could use KeywordPlanIdeaService with keyword_seed to generate keyword ideas based on the seed in Google Ads API. Please refer to this code sample (Python client libraries) to generate keyword ideas from a list of seed keywords.
Get keyword ideas based on seed and category: It is not possible to get the keyword ideas based on seed and category in Google Ads API.
Get keyword ideas based on input website e.g. https://www.example.com: You could use KeywordPlanIdeaService with url_seed to generate keyword ideas based on the website in Google Ads API.
Is there an option to exclude brand names from results in Google Ads API? It is not possible to exclude brand names from the results in Google Ads API.
Let us know if you need additional information.
Regards,
Nikisha Patel, Google Ads API Team