Hi,
I am getting an error when trying to make a request
to TargetingIdeaService, here is how I make the call (using python):
PAGE_SIZE = 100
kw_search_volume = []
# Initialize appropriate service.
targeting_idea_service = client.GetService('TargetingIdeaService',
version='v201509')
# Construct selector object and retrieve related keywords.
offset = 0
selector = {
'searchParameters': [
{
'xsi_type': 'RelatedToQuerySearchParameter',
'queries': keywords (** a list of keywords - always under the
800 limit)
},
],
'ideaType': 'KEYWORD',
'requestType': 'STATS',
'requestedAttributeTypes': ['KEYWORD_TEXT', 'SEARCH_VOLUME'],
'paging': {
'startIndex': str(offset),
'numberResults': str(PAGE_SIZE)
}
}
more_pages = True
while more_pages:
page = targeting_idea_service.get(selector)
# Display results.
if 'entries' in page:
for result in page['entries']:
attributes = {}
for attribute in result['data']:
attributes[attribute['key']] = getattr(attribute['value'],
'value','0')
print ('Keyword \'%s\' average monthly search volume '
'\'%s\n'
% (attributes['KEYWORD_TEXT'],
attributes['SEARCH_VOLUME']))
kw_volume = {}
kw_volume['keyword'] = attributes['KEYWORD_TEXT']
kw_volume['volume'] = attributes['SEARCH_VOLUME']
kw_search_volume.append(kw_volume)
print
else:
print 'No related keywords were found.'
offset += PAGE_SIZE
selector['paging']['startIndex'] = str(offset)
more_pages = offset < int(page['totalNumEntries'])
Here is the error message:
Server raised fault: '[DistinctError.DUPLICATE_ELEMENT @
selector.searchParameters[0].queries[154], DistinctError.DUPLICATE_ELEMENT @
selector.searchParameters[0].queries[289]]'
Not sure what is the duplicates referring to
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/2a519f38-4b97-4a63-b84a-2f96f37ddf66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.