Thanks for the response. I noticed that in the api it is mentioned that "get" method returns a page of ideas that match the query described by the specified TargetingIdeaSelector. The selector must specify a Paging value, with numberResults set to 800 or less. If I need to get stats for 4000 keywords, then my understanding is that I need to make 5 calls by calling setStartIndex() and setNumberResults() with different values in each call? To be precise those 5 calls to get () method would be made with following values set on Paging object, setStartIndex(0) and setNumberResults(800) setStartIndex(801) and setNumberResults(1600) setStartIndex(1601) and setNumberResults(2400) setStartIndex(2401) and setNumberResults(3200) setStartIndex(3201) and setNumberResults(4000).
Please correct me if I am wrong. Thanks, On Jan 14, 4:02 pm, AdWords API Advisor <adwordsapiadvi...@google.com> wrote: > Hi, > > Certain data isn't returned in the sandbox, and all the data that is > returned is dummy data. Local search volume is returned as > TARGETED_MONTHLY_SEARCHES, which uses the country and language targets > you specify. > > Best, > - Eric Koleda, AdWords API Team > > On Jan 12, 6:58 pm, v <vjtadepa...@gmail.com> wrote: > > > Hello, > > > I am using TargetingIdeaService to find the following stats about a > > keyword: > > local search volume, global monthly search volume, search volume > > trends, highest volume occurred in. > > > I have the code below working but I am not sure what API call I need > > to use to get "local search volume". When I looked up online, it seems > > KeywordVariation.getLastMonthSearchVolume is equivalent to "local > > search volume", but for that I have to use KeywordToolService ad I > > would rather stick to TargetingIdeaService as I am using the latest > > version of adwords api(v2009) . I also noticed that data related to > > "AVERAGE_TARGETED_MONTHLY_SEARCHES" never comes back. Any ideas? > > > Thanks in advance, > > > CODE: > > > public class GetRelatedKeywords { > > private static final String email = "......"; > > private static final String password = "......"; > > // private static final String clientEmail = "......"; > > private static final String useragent = "......"; > > private static final String developerToken = "......"; > > private static final String applicationToken = "......"; > > > private static final String namespace = "https://adwords.google.com/ > > api/adwords/v13"; > > > public static void main(String[] args) throws Exception { > > // Log SOAP XML request and response. > > AdWordsServiceLogger.log(); > > > AdWordsUser user = new AdWordsUser(email, password, > > useragent, > > developerToken, applicationToken); > > > // Get the TargetingIdeaService. > > TargetingIdeaServiceInterface targetingIdeaService = user > > > > .getService(AdWordsService.V200909.TARGETING_IDEA_SERVICE, > > > > "https://adwords-sandbox.google.com/api/adwords/o/v200909/ > > TargetingIdeaService"); > > > Keyword[] kwa = new Keyword[1]; > > kwa[0] = new Keyword(); > > kwa[0].setText("cheap airline tickets"); > > kwa[0].setMatchType(KeywordMatchType.EXACT); > > > LanguageTarget lt = new LanguageTarget(); > > lt.setLanguageCode("en"); > > CountryTarget ct = new CountryTarget(); > > ct.setCountryCode("US"); > > > // Create selector. > > TargetingIdeaSelector selector = new > > TargetingIdeaSelector(); > > selector.setRequestType(RequestType.STATS); > > selector.setIdeaType(IdeaType.KEYWORD); > > selector.setLocaleCode("en_US"); > > selector.setRequestedAttributeTypes(new AttributeType[] { > > AttributeType.KEYWORD, > > AttributeType.COMPETITION, > > AttributeType.TARGETED_MONTHLY_SEARCHES, > > > > AttributeType.AVERAGE_TARGETED_MONTHLY_SEARCHES, > > AttributeType.GLOBAL_MONTHLY_SEARCHES }); > > > // Set selector paging (required for targeting idea > > serivce). > > Paging paging = new Paging(); > > paging.setStartIndex(0); > > paging.setNumberResults(1); > > selector.setPaging(paging); > > > // Create related to keyword search parameter. > > RelatedToKeywordSearchParameter > > relatedToKeywordSearchParameter = > > new RelatedToKeywordSearchParameter(); > > relatedToKeywordSearchParameter.setKeywords(kwa); > > selector.setSearchParameters(new SearchParameter[] { > > relatedToKeywordSearchParameter, > > new LanguageTargetSearchParameter(null, > > new LanguageTarget[] { lt > > }), > > new CountryTargetSearchParameter(null, > > new CountryTarget[] { ct }) > > }); > > > // Get related keywords. > > TargetingIdeaPage page = targetingIdeaService.get(selector); > > > // Display related keywords. > > if (page.getEntries() != null && page.getEntries().length > > > 0) { > > for (TargetingIdea targetingIdea : > > page.getEntries()) { > > Type_AttributeMapEntry[] data = > > targetingIdea.getData(); > > for (int i = 0; i < data.length; i++) { > > > > System.out.println(data[i].getKey()); > > if (data[i].getKey().equals( > > > > AttributeType.TARGETED_MONTHLY_SEARCHES)) { > > > MonthlySearchVolume[] msvs > > = ((MonthlySearchVolumeAttribute) data > > [i] > > > > .getValue()).getValue(); > > for (MonthlySearchVolume > > msv : msvs) { > > > > > System.out.println(msv.getMonth()); > > > > System.out.println(msv.getYear()); > > > > System.out.println(msv.getCount()); > > } > > } else if (data[i].getKey().equals( > > > > AttributeType.GLOBAL_MONTHLY_SEARCHES)) { > > > > > System.out.println(((LongAttribute) data[i].getValue()) > > > > .getValue()); > > } else if (data[i].getKey().equals( > > > > AttributeType.COMPETITION)) { > > > > > System.out.println(((DoubleAttribute) data[i] > > > > .getValue()).getValue()); > > } else if (data[i].getKey().equals( > > > > AttributeType.AVERAGE_TARGETED_MONTHLY_SEARCHES)) { > > > > > System.out.println(((DoubleAttribute) data[i] > > > > .getValue()).getValue()); > > } else if > > (data[i].getKey().equals(AttributeType.KEYWORD)) > > { > > > > System.out.println(((KeywordAttribute) data[i] > > > > .getValue()).getValue().getText()); > > > > System.out.println(((KeywordAttribute) data[i] > > > > .getValue()).getValue().getMatchType()); > > } > > } > > > } > > } else { > > System.out.println("No related keywords were > > found."); > > } > > } > > > }
-- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to adwords-...@googlegroups.com. To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en.