How to get local monthly searches on .Net?

74 views
Skip to first unread message

parviz

unread,
Jun 20, 2010, 12:18:27 PM6/20/10
to AdWords API Forum
I am using this api code for getting the keyword variation.

Now my goal is to get for each keyword variation the number of monthly
local searches.


AdWordsUser user = new AdWordsUser();
TargetingIdeaService targetingIdeaService =

(TargetingIdeaService)user.GetService(AdWordsService.v201003.TargetingIdeaService);

string keywordText = "buy something";

Keyword keyword = new Keyword();
keyword.text = keywordText;
keyword.matchTypeSpecified = true;
keyword.matchType = KeywordMatchType.BROAD;

RelatedToKeywordSearchParameter searchParameter = new
RelatedToKeywordSearchParameter();
searchParameter.keywords = new Keyword[] { keyword };

TargetingIdeaSelector selector = new TargetingIdeaSelector();
selector.searchParameters = new SearchParameter[]
{ searchParameter };
selector.ideaTypeSpecified = true;
selector.ideaType = IdeaType.KEYWORD;
selector.requestTypeSpecified = true;
selector.requestType = RequestType.IDEAS;


Paging paging = new Paging();
paging.startIndex = 0;
paging.startIndexSpecified = true;
paging.numberResults = 20;
paging.numberResultsSpecified = true;

selector.paging = paging;

try
{
TargetingIdeaPage page =
targetingIdeaService.get(selector);



if (page != null && page.entries != null)
{
Response.Write(page.totalNumEntries + keywordText +
page.entries.Length);

foreach (TargetingIdea idea in page.entries)
{
foreach (Type_AttributeMapEntry entry in
idea.data)
{
if (entry.key == AttributeType.KEYWORD)
{
KeywordAttribute kwdAttribute =
entry.value as KeywordAttribute;

Response.Write(kwdAttribute.value.text
+"<br />");

}
}
}
}
else
{
Response.Write("No related keywords were found for
your keyword.");
}
}
catch (Exception ex)
{
Response.Write(ex.Message);
}










Any help please??

AdWords API Advisor

unread,
Jun 21, 2010, 5:50:10 PM6/21/10
to AdWords API Forum
Hi,

You can request either the TARGETED_MONTHLY_SEARCHES or
AVERAGE_TARGETED_MONTHLY_SEARCHES attributes to get this information.

Best,
- Eric Koleda, AdWords API Team

Jeremy Brooks

unread,
Dec 9, 2010, 8:12:33 PM12/9/10
to adwor...@googlegroups.com
Eric,
  I cannot seem to find, in the documentation, how to specify either a metro code or coordinates for a geo target in the TargetingIdeaService.  Is this even possible?
I need to be able to check volume for local businesses.

Thanks,
   Jeremy

AdWords API Advisor

unread,
Dec 10, 2010, 6:39:25 PM12/10/10
to AdWords API Forum
Hi Jeremy,

Only CountryTargets can be used in the TargetingIdeaService.

Best,
- Eric

Benjamin Aadalen

unread,
Mar 4, 2011, 7:55:31 AM3/4/11
to adwor...@googlegroups.com
Hi,

What is the correct code to get the global monthly searches of the keyword?

I recieve following exception: "An API exception has occurred. See ApiException and InnerException fields for more details."

Thanks!

Eric Koleda

unread,
Mar 6, 2011, 8:15:37 PM3/6/11
to adwor...@googlegroups.com
Hi Benjamin,

The global monthly search volume can be retrieved with the attribute GLOBAL_MONTHLY_SEARCHES:


Best,
- Eric
Reply all
Reply to author
Forward
0 new messages