Same problem here with the .NET API, here's the code:

            TargetingIdeaPage page;
            var user = new AdWordsUser();
            var searchVolumes = new Dictionary< string, long >();
            var targetingIdeaService = ( TargetingIdeaService 
)user.GetService( AdWordsService.v201209.TargetingIdeaService );
            var paging = new Paging { startIndex = 0, numberResults = 3 };
            var keywordSelector = new TargetingIdeaSelector
                {
                    requestType = RequestType.STATS,
                    ideaType = IdeaType.KEYWORD,
                    requestedAttributeTypes = new[]
                        {
                            AttributeType.KEYWORD_TEXT,
                            AttributeType.SEARCH_VOLUME
                        },
                    paging = paging
                };
            var relatedToQuerySearchParameter = new 
RelatedToQuerySearchParameter { queries = new[] { "jobbörse", "jobsuche", 
"stellenangebote" } };
            var locationSearchParameter = new LocationSearchParameter { 
locations = new[] { new Location { id = 2276, CriterionType = "Location" } 
} };
            var deviceTypeSearchParameter = new DeviceTypeSearchParameter { 
deviceType = DeviceType.DESKTOPS_AND_LAPTOPS };
            keywordSelector.searchParameters = new SearchParameter[] { 
relatedToQuerySearchParameter, locationSearchParameter, 
deviceTypeSearchParameter };

            page = targetingIdeaService.get( keywordSelector );

            if ( page.entries == null || page.entries.Length <= 0 ) return;

            foreach ( var targetingIdea in page.entries )
            {
                var keyword = ( targetingIdea.data.Single( d => d.key == 
AttributeType.KEYWORD_TEXT ).value as StringAttribute ).value;
                var searchVolume = ( targetingIdea.data.Single( d => d.key 
== AttributeType.SEARCH_VOLUME ).value as LongAttribute ).value;
                searchVolumes.Add( keyword, searchVolume );
            }

            foreach ( var searchVolume in searchVolumes )
                Console.WriteLine( "{0}, {1}", searchVolume.Key, 
searchVolume.Value );

Output:

jobbörse, 1830000
jobsuche, 110000
stellenangebote, 368000

Where the UI reports the following:

jobbörse, 1,830,000
jobsuche, 90,000
stellenangebote, 246,000

The only thing I wasn't able to specify in code is the match type ("exact") 
but I think I read somewhere that it actually defaults to that when not 
specified...

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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

Reply via email to