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