Getting global or local search volume of a keyword via API

776 views
Skip to first unread message

Bikram Choudhury The SEO & PHP Developer

unread,
Jan 31, 2011, 4:47:00 AM1/31/11
to AdWords API Forum, bikram.c...@gmail.com
Hi,

I am very new to Adwords API.

My target is to "Get global or local search volume of a keyword via
API".

So my current project is: A textbox in a page, a submit button. In
textbox you can type any keyword and then you will get results after
submitting the button.

Also I have in mind to use Yahoo or WordTracker API. But I have no
idea which is better. So I want to start with Adwords API.

Can anybody help?
bikram.c...@gmail.com

AdWords API Advisor

unread,
Feb 2, 2011, 3:49:57 PM2/2/11
to AdWords API Forum
Hi Bikram,

The TargetingIdeaService can be used to retrieve the search volume of
keywords. Use it in STATS mode and you can batch up to 2000 keywords
per request.

http://code.google.com/apis/adwords/docs/reference/latest/TargetingIdeaService.html

Best,
- Eric Koleda, AdWords API Team

On Jan 30, 11:47 pm, "Bikram Choudhury The SEO & PHP Developer"
> bikram.chowdh...@gmail.com
Message has been deleted

santhosh kumar

unread,
Oct 14, 2011, 12:22:05 PM10/14/11
to adwor...@googlegroups.com, bikram.c...@gmail.com

Hi Bikram,

I am also very new to Adwords API.

My target is to "Get global or local search result of a keyword via
API".

So my current project is: A textbox in a page, a submit button. In
textbox you can type any keyword and then you will get results after
submitting the button.  

How to work on sandbox environment using with testing tokens.  

Please provide steps to follow the sandbox.

Please provide any use full links to use sandbox.
 
Regards,
Santhosh.A

Anash P. Oommen

unread,
Oct 17, 2011, 11:44:23 AM10/17/11
to adwor...@googlegroups.com, bikram.c...@gmail.com
Hi Santhosh,

See http://code.google.com/apis/adwords/docs/sandbox.html for details on how to use the sandbox.

Cheers,
Anash P. Oommen,
AdWords API Advisor.

santhosh kumar

unread,
Oct 17, 2011, 3:33:32 PM10/17/11
to AdWords API Forum
Hi Anish,

Thanks for your response.

How to generate Auth Token to access the Sandbox URL(POC environment),

In place of developer token iam passing login++currency_code
(….@gmail.com++USD is it correct format?) .

Please provide an java example code to work with sandbox URL in
testing (POC purpose).

Silly questions what is user Agent? (Please provide the format)

Regards,
Santhosh.A


On Oct 17, 4:44 pm, "Anash P. Oommen" <anash.p.oommen
+fo...@google.com> wrote:
> Hi Santhosh,
>
> Seehttp://code.google.com/apis/adwords/docs/sandbox.htmlfor details on how

santhosh kumar

unread,
Oct 17, 2011, 4:08:43 PM10/17/11
to AdWords API Forum
Hi Anash,

While working with Sandbox Url(POC Environment) iam getting below msg.

javax.xml.rpc.ServiceException: Could not get ClientLogin token for
user: Auth token could not be retrieved because of IOException: www.google.com

at com.google.api.adwords.lib.AdWordsVersion
$AdWordsVersionV201101.setHeaders(AdWordsVersion.java:359)

at
com.google.api.adwords.lib.AdWordsServiceFactory.getConfiguredStub(AdWordsServiceFactory.java:
184)

at
com.google.api.adwords.lib.AdWordsServiceFactory.generateServiceStub(AdWordsServiceFactory.java:
104)

at
com.google.api.adwords.lib.AdWordsUser.getService(AdWordsUser.java:
337)

at
com.Mphasis.helloworld.GetRelatedKeywords.main(GetRelatedKeywords.java:
67)

Please provide the solution.

Regards,
Santhosh.A

On Oct 17, 4:44 pm, "Anash P. Oommen" <anash.p.oommen
+fo...@google.com> wrote:
> Hi Santhosh,
>
> Seehttp://code.google.com/apis/adwords/docs/sandbox.htmlfor details on how

Anash P. Oommen

unread,
Oct 21, 2011, 6:42:54 AM10/21/11
to adwor...@googlegroups.com
Hi Santhosh,

Since you are using AdWords API Java library, the issue of generating ClientLogin token is no longer relevant; the library will take care of you. As for IOException, looks like the library has some issue reaching https://www.google.com/accounts/ClientLogin. Are you still facing issues making calls to the sandbox?

As for the credentials, your username/password is gmail account/password, useragent is any random string (preferably company name + application name) that can be used to identify your application, and developer token is gmail account++CUR, e.g. john...@gmail.com++USD.

santhosh kumar

unread,
Oct 21, 2011, 6:21:57 PM10/21/11
to adwor...@googlegroups.com
Hi Anash,

I'm using the AdWords Sandbox API for the first time. I'm using the
java client library(V201101) to access the API. When I tried calling
the TargetingIdeaService service, I'm getting the
AuthenticationError.NOT_ADS_USER error.

Error:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
faultSubcode:
faultString: AuthenticationError.NOT_ADS_USER @ ;
trigger:'843246365515' Service[TargetingIdeaService.get]
faultActor:
faultNode:
faultDetail:
{https://adwords.google.com/api/adwords/o/v201101}
ApiExceptionFault:
<ns2:message>AuthenticationError.NOT_ADS_USER @ ;
trigger:'843246365515'
Service[TargetingIdeaService.get]
</ns2:message>
<ns2:ApplicationException.Type>ApiException</
ns2:ApplicationException.Type>
<ns2:errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="ns2:AuthenticationError">
<ns2:fieldPath/>
<ns2:trigger>843246365515</ns2:trigger>
<ns2:errorString>AuthenticationError.NOT_ADS_USER</ns2:errorString>
<ns2:ApiError.Type>AuthenticationError</ns2:ApiError.Type>
<ns2:reason>NOT_ADS_USER</ns2:reason>
</ns2:errors>


Please provide me the sample java code for access the SandBox
URL(https://adwords-sandbox.google.com/) .

I'm stuck and not sure what I'm doing wrong. It would be great if
someone could point me in the right direction.

Thanks in advance
Santhosh.A

David Torres

unread,
Oct 24, 2011, 1:21:53 PM10/24/11
to adwor...@googlegroups.com
Hi Santhosh,

Could you post the snippet of your code that is throwing the error? I'll be glad to look at it and point out any issues.

Best,

-David Torres - AdWords API Team

santhosh kumar

unread,
Oct 25, 2011, 6:21:29 AM10/25/11
to AdWords API Forum

Hi David,

The below code iam using.

public class GetRelatedKeywords {
public static void main(String[] args) {
try {
// Log SOAP XML request and response.
AdWordsServiceLogger.log();

// Get AdWordsUser from "~/adwords.properties".
AdWordsUser user = new AdWordsUser();
String authToken = new AuthToken(user.getEmail(),
user.getPassword()).getAuthToken();
user.setAuthToken(authToken);




// Get the TargetingIdeaService.
TargetingIdeaServiceInterface targetingIdeaService =

user.getService(AdWordsService.V201101.TARGETING_IDEA_SERVICE);

// Create seed keyword.
Keyword keyword = new Keyword();
keyword.setText("Car");
keyword.setMatchType(KeywordMatchType.BROAD);

// Create selector.
TargetingIdeaSelector selector = new TargetingIdeaSelector();

selector.setRequestType(RequestType.IDEAS);
selector.setIdeaType(IdeaType.KEYWORD);
selector.setRequestedAttributeTypes(new AttributeType[]
{AttributeType.CRITERION,
AttributeType.AVERAGE_TARGETED_MONTHLY_SEARCHES});

// Set selector paging (required for targeting idea service).
Paging paging = new Paging();
paging.setStartIndex(0);
paging.setNumberResults(10);
selector.setPaging(paging);

// Create related to keyword search parameter.
RelatedToKeywordSearchParameter relatedToKeywordSearchParameter
=
new RelatedToKeywordSearchParameter();
relatedToKeywordSearchParameter.setKeywords(new Keyword[]
{keyword});

// Create keyword match type search parameter to ensure unique
results.
KeywordMatchTypeSearchParameter keywordMatchTypeSearchParameter
=
new KeywordMatchTypeSearchParameter();
keywordMatchTypeSearchParameter
.setKeywordMatchTypes(new KeywordMatchType[]
{KeywordMatchType.BROAD});

selector.setSearchParameters(new SearchParameter[]
{relatedToKeywordSearchParameter,
keywordMatchTypeSearchParameter});

// Get related keywords.
TargetingIdeaPage page = targetingIdeaService.get(selector);

// Display related keywords.
if (page.getEntries() != null && page.getEntries().length > 0) {
for (TargetingIdea targetingIdea : page.getEntries()) {
Map<AttributeType, Attribute> data =
MapUtils.toMap(targetingIdea.getData());
keyword = (Keyword) ((CriterionAttribute)
data.get(AttributeType.CRITERION)).getValue();
Long averageMonthlySearches =
((LongAttribute)
data.get(AttributeType.AVERAGE_TARGETED_MONTHLY_SEARCHES))
.getValue();
System.out.println("Keyword with text '" + keyword.getText()
+ "', match type '"
+ keyword.getMatchType() + "', and average monthly
search volume '"
+ averageMonthlySearches + "' was found.");
}
} else {
System.out.println("No related keywords were found.");
}
} catch (Exception e) {
e.printStackTrace();
}
}
}

Please provide me the sample java code for access the SandBox
URL(https://adwords-sandbox.google.com/).

I'm stuck and not sure what I'm doing wrong. It would be great if
someone could point me in the right direction.

Thanks in advance
Santhosh.A

David Torres

unread,
Oct 26, 2011, 6:12:27 PM10/26/11
to adwor...@googlegroups.com
Hi Santhosh,

Your code seems to be fine, are you behind a firewall or a proxy that might be preventing from you to access the auth token endpoint?

Judging from the error an IOException means a communication error.

Best,

-David
Reply all
Reply to author
Forward
0 new messages