Hi,
I've been using looking at the sample code to generate keyword idea provided here:
Everything works fine except the parsing of the response data which doesn't look correct to me. Can someone clarify if this is expected behaviour?
This is the code provided to parse and print out the results:
| if 'entries' in page: |
| for result in page['entries']: |
| attributes = {} |
| for attribute in result['data']: |
| attributes[attribute['key']] = attribute['value'] |
| print ('Keyword with \'%s\' text and average monthly search volume ' |
| '\'%s\' was found with Products and Services categories: %s.' |
| % (attributes['KEYWORD_TEXT'], |
| attributes['SEARCH_VOLUME'], |
| attributes['CATEGORY_PRODUCTS_AND_SERVICES'])) |
From this, I would expect to get something along the lines of following:
Keyword with [my keyword] text and average monthly search volume [X] was found with Products and Services categories: [A, B, C].
What I'm actually seeing is more like this with the full attribute information:
Keyword with '(StringAttribute){
Attribute.Type = "StringAttribute"
value = "banff"
}' text and average monthly search volume '(LongAttribute){
Attribute.Type = "LongAttribute"
value = 135000
}
...
I'm certain I'm missing something obvious here so any pointers in the right direction would be most appreciated.