AdWords Api returns different number of results than requested in query

32 views
Skip to first unread message

Confused AdWords Guy

unread,
Nov 15, 2017, 2:32:57 AM11/15/17
to AdWords API Forum
I'm working on a C# application using the Adwords .NET library to determine search rates for potential campaigns.
All seems to work well, except that some search queries don't return a SEARCH_VOLUME result.

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 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 };

            var targetIdeaPage = targetIdeaService.get(targetIdeaSelector);

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

Output: 0


In my real application, there's around ~500+ queries per request to help prevent Rate issues. Since the api doesn't error, and simply doesn't return a value, I have no way of knowing what one failed and it causes my lists to be different lengths.
Is there something I should be aware of in-terms of things that shouldn't queried, or some way to handle this situation?

Thanks

Reply all
Reply to author
Forward
0 new messages