Hi there,

I also wanted to get a month on month data using API. What's the 
solution? Please share here.

On Tuesday, May 2, 2017 at 7:28:34 AM UTC+5:30, vib...@nvidia.com wrote:
>
> Hello I'm using the targeting keyword Idea api to extract the search 
> volume of past searches of a speciifc word monthly. In the UI I can set the 
> date range and extract the month by month stats for the specific country 
> for past three years. In API I can get the annual stats. However when I 
> want to get the stats for three years month by month I'm nt able to 
> correctly use the date range feature in the python API of the Google 
> ADWORDS. I get the below error  
>
> TypeNotFound: Type not found: 'DateRange':
>
>
>
> This is my script. Please help
>
>
> from googleads import adwords
>
>
> PAGE_SIZE = 100
>
> start_date = '20140101'
> end_date = '20140101'
> def main(client):
>   # Initialize appropriate service.
>   targeting_idea_service = client.GetService(
>       'TargetingIdeaService', version='v201702')
>
>   # Construct selector object and retrieve related keywords.
>   offset = 0
>   selector = {
>       'searchParameters': [
>           {
>               'xsi_type': 'RelatedToQuerySearchParameter',
>               'queries': ['TRUMP DUMP']
>           },
>           {
>               # Language setting (optional).
>               # The ID can be found in the documentation:
>               #  
> https://developers.google.com/adwords/api/docs/appendix/languagecodes
>               'xsi_type': 'LanguageSearchParameter',
>               'languages': [{'id': '1000'}]
>           },
>           {
>               # Network search parameter (optional)
>               'xsi_type': 'NetworkSearchParameter',
>               'networkSetting': {
>                   'targetGoogleSearch': True,
>                   'targetSearchNetwork': False,
>                   'targetContentNetwork': False,
>                   'targetPartnerSearchNetwork': False
>               }
>           }
>       ],
>       'ideaType': 'KEYWORD',
>       'requestType': 'STATS',
>       'requestedAttributeTypes': ['KEYWORD_TEXT', 'SEARCH_VOLUME',
>                                   'TARGETED_MONTHLY_SEARCHES'],
>       'paging': {
>           'startIndex': str(offset),
>           'numberResults': str(PAGE_SIZE)
>       },
>     
>         'DateRange':{
>             'min': '20140101',
>              'max': '20170101'
>         }
>     
>       
>     
>         
>   }
>
>   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 with \'%s\' text and average monthly search volume '
>                '\'%s\' was found with Products and Services categories: %s.'
>                % (attributes['KEYWORD_TEXT'],
>                   attributes['SEARCH_VOLUME'],
>                   attributes['TARGETED_MONTHLY_SEARCHES']))
>       print
>     else:
>       print 'No related keywords were found.'
>     offset += PAGE_SIZE
>     selector['paging']['startIndex'] = str(offset)
>     more_pages = offset < int(page['totalNumEntries'])
>
>
> if __name__ == '__main__':
>   # Initialize client object.
>   adwords_client = adwords.AdWordsClient.LoadFromStorage()
>
>   main(adwords_client)
>
>
>
-- 
Read the Latest Case Study: How AegonLife saw a 12% Increase in Policy 
Purchases with Tatvic & Google Analytics 360 
<https://www.tatvic.com/about-us/case-studies/heatmap-and-user-journey-analysis-with-ga-360-quote-retrieval-feature/?utm_source=tatvic_mail_footer&utm_medium=email&utm_campaign=webinar_outreach>

Based on your experience with Tatvic, how likely are you to recommend us to 
a friend or a colleague?

Click on the star to rate (1 being least likely and 5 being most likely)
<https://www.tatvic.com/nps-feedback/?rating=0>

*Thank you for reading this far. This email may be *confidential* or 
*privileged*. If you received this communication by mistake, please don't 
forward it to anyone else. Please erase all copies and attachments, and let 
me know that it went to the wrong person.*

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
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/ed5e5512-012a-4193-b6b7-9faf51b73cee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to