dotNET api returns no values for some queries.

30 views
Skip to first unread message

Brett Parshall

unread,
Nov 15, 2017, 2:32:58 AM11/15/17
to AdWords API Forum

I set up a project using the .NET Adwords API.
I'm querying a large number (100s of thousands) of potential search terms for their SEARCH_VOLUME to decide which to target.
The api works as expected except for occasionally the API returns fewer results than the number of queries I sent it.
After narrowing it down, one of the problem search terms turned out to be simply 'amherst properties'
In this example, the API returns 0 results for the one search term.
This results in my lists being of different lengths, and I don't know which term failed to return a value so I've been unable to identify a proper fix for it this far. 
Are there search term constraints that I don't know about, or some other method to handle this?
I can't request one term at a time due to the sheer number of queries I'm testing.

using System;
using Google.Api.Ads.AdWords.Lib;
using Google.Api.Ads.AdWords.v201710;

namespace WpfApp1
{
    internal class MyClass
    {
        public MyClass()
        {
            AdWordsUser user = new AdWordsUser();
            TargetingIdeaService targetIdeaService = (TargetingIdeaService)user.GetService(AdWordsService.v201710.TargetingIdeaService);
            TargetingIdeaSelector targetIdeaSelector = new TargetingIdeaSelector();
            targetIdeaSelector.ideaType = IdeaType.KEYWORD;
            targetIdeaSelector.requestType = RequestType.STATS;
            targetIdeaSelector.requestedAttributeTypes = new AttributeType[] { AttributeType.SEARCH_VOLUME };

            var adultContentSearchParameter = new IncludeAdultContentSearchParameter();
            var locationSearchParam = new LocationSearchParameter();
            var searchLocation = new Location();
            searchLocation.id = 2840; //United States
            locationSearchParam.locations = new Location[] { searchLocation };

            targetIdeaSelector.paging = new Paging();
            targetIdeaSelector.paging.numberResults = 600;
            targetIdeaSelector.paging.startIndex = 0;

            var relatedQuerySearchParam = new RelatedToQuerySearchParameter();
            relatedQuerySearchParam.queries = new string[] { "amherst properties" };

            targetIdeaSelector.searchParameters = new SearchParameter[] { locationSearchParam, relatedQuerySearchParam, adultContentSearchParameter };

            var targetIdeaPage = targetIdeaService.get(targetIdeaSelector);

            Console.WriteLine(targetIdeaPage.totalNumEntries);
        }
    }
}

Thanks,
Brett

Peter Oliquino

unread,
Nov 15, 2017, 4:05:04 AM11/15/17
to AdWords API Forum
Hi Brett, 

To better investigate the issue, could you provide the complete SOAP request and response generated when you didn't get any results? Also, could you try the same exact request using the Keywords Planner of the AdWords UI, using also the same filters you applied in your AdWords API request and send to me the complete screenshot with the results? You may reply using the Reply privately to author option.

Additionally, could you confirm if you were also the author to this similar thread?

Best regards,
Peter
AdWords API Team
Reply all
Reply to author
Forward
0 new messages