Get keyword ideas and traffic estimates in C#, Java, PHP, or Python.
Page Headers
0 | HTTP/1.0 301 Moved Permanently |
Location | /en-us/advertising/guides/code-example-keyword-planner?view=bingads-13 |
Request-Context | Array |
X-Datacenter | Array |
X-Frame-Options | Array |
x-content-type-options | Array |
X-UA-Compatible | Array |
X-XSS-Protection | Array |
Strict-Transport-Security | Array |
Content-Length | 0 |
Cache-Control | Array |
Expires | Array |
Date | Array |
Connection | Array |
Akamai-Cache-Status | Array |
report-to | Array |
nel | Array |
1 | HTTP/1.0 200 OK |
Content-Type | text/html |
ETag | “o9VNQratb7xlW1FrDSmv3gZrtx+eMpmqr02CJsf6nV0=” |
X-Rendering-Stack | Dynamic |
Keyword Frequency
quot | 198 |
keyword | 196 |
new | 184 |
gt | 165 |
search | 110 |
adinsight | 91 |
use | 77 |
service | 64 |
you | 61 |
microsoft | 58 |
Keyword Cloud
Keyword Planner Code Example – Microsoft Advertising Docs Skip to main content Global navigation Documentation Learn Samples More Contents Exit focus mode Language Bookmark Feedback Edit Share Twitter LinkedIn Facebook Email Table of contents minutes read In this article This example demonstrates how get keyword ideas and traffic estimates for search advertising campaigns Tip Use the language selector in documentation header choose C Java Php or Python To access refresh tokens your user make first service call using Bing Ads API see Quick Start sample You’ll want review Get Started guide walkthroughs preferred e g Supporting files examples are available at GitHub You can clone each repository repurpose snippets as needed System Collections Generic Linq ServiceModel Threading Tasks BingAds V AdInsight namespace BingAdsExamplesLibrary lt summary gt How public class KeywordPlanner ExampleBase override string Description return quot async Task RunAsync AuthorizationData authorizationData try ApiEnvironment environment OAuthDesktopMobileAuthCodeGrant Authentication Environment AdInsightExampleHelper new OutputStatusMessageDefault OutputStatusMessage AdInsightService ServiceClient IAdInsightService GetKeywordIdeaCategories operation a list valid category identifiers A identifier will be used CategorySearchParameter below —– nGetKeywordIdeaCategories var getKeywordIdeaCategoriesResponse await GetKeywordIdeaCategoriesAsync categoryId long KeywordIdeaCategories ToList CategoryId Format must specify attributes that you returned KeywordIdea ideaAttributes List KeywordIdeaAttribute AdGroupId AdGroupName AdImpressionShare Competition MonthlySearchCounts Relevance Source SuggestedBid endDateTime DateTime UtcNow AddMonths Only one SearchParameter type specified per searchParameters Determines start end month data with The date range parameter is optional If do not include DateRangeSearchParameter GetKeywordIdeas request then able confirm whether item within previous prior most recent month’s yet an error EndDate DayMonthAndYear Day Month Year StartDate corresponds filling ‘Your product category’ under ‘Search keywords phrase website web application’s tool One more QuerySearchParameter UrlSearchParameter required ‘Product service’ When calling if ExpandIdeas false Queries tennis shoes running cross training landing page’ Url contoso com LanguageSearchParameter LocationSearchParameter NetworkSearchParameter correspond ‘Keyword Planner’ ‘Targeting’ workflow application Each these parameters exactly Languages LanguageCriterion English least location Locations LocationCriterion United States LocationId Network NetworkCriterion NetworkType OwnedAndOperatedAndSyndicatedSearch CompetitionSearchParameter ExcludeAccountKeywordsSearchParameter IdeaTextSearchParameter ImpressionShareSearchParameter SearchVolumeSearchParameter SuggestedBidSearchParameter options’ options refine what we suggest limit by historical hide already account exclude specific CompetitionLevels CompetitionLevel High Medium Low ExcludeAccountKeywords match Broad supported Excluded Text court MatchType pro Included athletic clothing Equivalent ‘ value Maximum Minimum ‘value null both Setting device criterion DeviceSearchParameter default aggregated all devices Device DeviceCriterion Possible values All Computers Tablets Smartphones DeviceName nGetKeywordIdeas getKeywordIdeasResponse GetKeywordIdeasAsync expandIdeas true keywordIdeas KeywordIdeas Count No OutputArrayOfKeywordIdea Let’s idea ad group ID either negative Negative map into suggested groups indicates was sourced from use seed submitted same adGroupIds Select Distinct adGroupEstimatorCount seedOffset Contains adGroupEstimators AdGroupEstimator int index reserved future based on any We add estimators while iterating KeywordEstimators KeywordEstimator Optionally set level max CPC maximum bid MaxCpc foreach keywordIdea keywordEstimator Id Exact Phrase Round two decimal places Add Currently only CampaignEstimator were above AdGroupEstimators CampaignId campaign DailyBudget NegativeKeywords NegativeKeyword foo network criterions Criteria Criterion name equivalent omitting nGetKeywordTrafficEstimates getKeywordTrafficEstimatesResponse GetKeywordTrafficEstimatesAsync campaignEstimators CampaignEstimates OutputArrayOfCampaignEstimate Catch authentication exceptions catch OAuthTokenRequestException ex Couldn’t OAuth Error Details FaultException AdApiFaultDetail Join Detail Errors Message ApiFaultDetail OperationErrors BatchErrors Exception package microsoft bingads v import java util ArrayList Calendar HashSet adinsight extends static void lang String args getAuthorizationData ENVIRONMENT outputStatusMessage GetKeywordIdeaCategoriesResponse getKeywordIdeaCategories format requires categories Long getCategoryId s ArrayOfKeywordIdeaAttribute getKeywordIdeaAttributes AD GROUP NAME IMPRESSION SHARE COMPETITION KEYWORD MONTHLY SEARCH COUNTS RELEVANCE SOURCE SUGGESTED BID ArrayOfSearchParameter calendar getInstance dateRangeSearchParameter endDate setDay setMonth setYear startDate setEndDate setStartDate getSearchParameters categorySearchParameter setCategoryId querySearchParameter ArrayOfstring queries getStrings setQueries urlSearchParameter setUrl languageSearchParameter ArrayOfLanguageCriterion languages englishLanguage setLanguage getLanguageCriterions setLanguages locationSearchParameter ArrayOfLocationCriterion locations unitedStatesLocationCriterion setLocationId L between getLocationCriterions setLocations networkSearchParameter networkCriterion setNetwork OWNED AND OPERATED SYNDICATED competitionSearchParameter ArrayOfCompetitionLevel competitionLevels getCompetitionLevels LOW MEDIUM HIGH setCompetitionLevels excludeAccountKeywordsSearchParameter setExcludeAccountKeywords ideaTextSearchParameter ArrayOfKeyword excludedKeywords excludedKeyword setText setMatchType BROAD getKeywords includedKeywords includedKeyword setExcluded setIncluded impressionShareSearchParameter setMaximum D setMinimum searchVolumeSearchParameter suggestedBidSearchParameter deviceSearchParameter deviceCriterion setDeviceName setDevice GetKeywordIdeasResponse getKeywordIdeas ArrayOfKeywordIdea size outputArrayOfKeywordIdea ArrayOflong keywordIdeaAdGroupIds getLongs getAdGroupId contains setAdGroupId setMaxCpc ArrayOfKeywordEstimator keywordEstimators setKeywordEstimators setId EXACT getKeyword setKeyword double maxCpc getSuggestedBid getKeywordEstimators ArrayOfCampaignEstimator campaignEstimator ArrayOfAdGroupEstimator adGroups getAdGroupEstimators setAdGroupEstimators setCampaignId setDailyBudget ArrayOfNegativeKeyword negativeKeywords negativeKeyword getNegativeKeywords setNegativeKeywords ArrayOfCriterion trafficEstimateCriteria getCriterions setCriteria getCampaignEstimators GetKeywordTrafficEstimatesResponse getKeywordTrafficEstimates outputArrayOfCampaignEstimate getCampaignEstimates faultXml ExampleExceptionHelper getBingAdsExceptionFaultXml out message handleBingAdsSDKException php For information about installing PHP SDK https go fwlink linkid require once DIR vendor autoload AuthHelper CampaignManagementExampleHelper SoapVar SoapFault Specify Auth classes ServiceClientType AdGroupEstimate KeywordEstimate CampaignEstimate Authenticate credentials print r n getKeywordIdeaCategoriesResponse- KeywordIdeaCategories- KeywordIdeaCategory printf array timezone ‘UTC’ now gmdate ‘Y-m-d H i s’ time dateRangeSearchParameterEndDate dateRangeSearchParameterEndDate- dateRangeSearchParameter- dateRangeSearchParameterStartDate dateRangeSearchParameterStartDate- SOAP ENC OBJECT ‘DateRangeSearchParameter’ GLOBALS ‘AdInsightProxy’ GetNamespace categorySearchParameter- ‘CategorySearchParameter’ querySearchParameter- ‘QuerySearchParameter’ urlSearchParameter- ‘UrlSearchParameter’ languageCriterion languageCriterion- languageSearchParameter- ‘LanguageCriterion’ ‘LanguageSearchParameter’ locationSearchParameter- locationCriterion locationCriterion- ‘LocationCriterion’ ‘LocationSearchParameter’ networkCriterion- networkSearchParameter- ‘NetworkCriterion’ ‘NetworkSearchParameter’ competitionSearchParameter- ‘CompetitionSearchParameter’ excludeAccountKeywordsSearchParameter- ‘ExcludeAccountKeywordsSearchParameter’ ideaTextSearchParameter- ‘IdeaTextSearchParameter’ impressionShareSearchParameter- ‘ImpressionShareSearchParameter’ searchVolumeSearchParameter- ‘SearchVolumeSearchParameter’ suggestedBidSearchParameter- ‘SuggestedBidSearchParameter’ deviceCriterion- deviceSearchParameter- ‘DeviceCriterion’ ‘DeviceSearchParameter’ getKeywordIdeasResponse- isset count estimator ideaAdGroupIds keywordIdeas- keywordIdea- unique SORT REGULAR IDs those via none where assigned adGroupEstimator adGroupEstimator- keyword- keywordEstimator- campaignEstimator- negativeKeyword- GetKeywordTrafficEstimates getKeywordTrafficEstimatesResponse- nFault e- faultcode faultstring dump detail nLast response ‘Proxy’ GetWsdl GetService getLastRequest getLastResponse Ignore fault caught getPrevious else getCode getMessage getTraceAsString auth helper output provide py def authorization factory create ‘ArrayOfKeywordIdeaAttribute’ append ‘AdGroupId’ ‘AdGroupName’ ‘AdImpressionShare’ ‘Competition’ ‘Keyword’ ‘MonthlySearchCounts’ ‘Relevance’ ‘Source’ ‘SuggestedBid’ status getkeywordideacategories id ‘KeywordIdeaCategory’ ‘ArrayOfSearchParameter’ ‘DayMonthAndYear’ query ‘ns ArrayOfstring’ ‘tennis’ ‘tennis shoes’ ‘running’ ‘running ‘cross training’ url ‘contoso com’ ‘ArrayOfLanguageCriterion’ ‘English’ ‘ArrayOfLocationCriterion’ ‘OwnedAndOperatedAndSyndicatedSearch’ competition levels ‘ArrayOfCompetitionLevel’ ‘High’ ‘Medium’ ‘Low’ False text excluded ‘ArrayOfKeyword’ ‘Broad’ court’ pro’ included ‘athletic clothing’ impression share volume None ‘All’ Populate IdeaAttributes SearchParameters True sys exit keywordidea ids ‘KeywordIdea’ distinct len offset ‘ArrayOfAdGroupEstimator’ ‘AdGroupEstimator’ ‘ArrayOfKeywordEstimator’ ‘KeywordEstimator’ ‘Exact’ ‘ArrayOfCampaignEstimator’ ‘CampaignEstimator’ ‘ArrayOfNegativeKeyword’ ‘NegativeKeyword’ ‘foo’ criteria ‘ArrayOfCriterion’ CampaignEstimators campaignestimate except WebFault webfault errors Main execution Loading client proxies customer developer token DEVELOPER TOKEN ‘AdInsightService’ version soap authenticate See Also Related Articles Is page helpful Yes Any additional feedback Submit Thank view View Theme Light Dark contrast Previous Version Blog Contribute Privacy amp Cookies Terms Site Trademarks copy