SuggestKeywordsFromExistingKeywords Service Operation - Ad Insight

Suggests keywords that could perform better than the specified keywords.

Request Elements

The SuggestKeywordsFromExistingKeywordsRequest object defines the body and header elements of the service operation request. The elements must be in the same order as shown in the Request SOAP.

Request Body Elements

Element Description Data Type
AdGroupId The identifier of the ad group for suggested keywords.

This element is not yet supported and may be used to influence keyword suggestions in a future release
CampaignId The identifier of the campaign for suggested keywords.

This element is not yet supported and may be used to influence keyword suggestions in a future release
ExcludeBrand A value that determines whether the results exclude brand keywords. To exclude brand keywords in the result, set to true. The default is false. boolean
Keywords An array of keywords for which you want to get suggested keywords that could perform better. The array can contain a maximum of 1,000 keywords, and each keyword can contain a maximum of 100 characters. string array
Language The language in which the keyword is written.

For possible values, see Ad Languages. See the Remarks section below for a list of providers that are supported for each language.

The default is English.
MaxSuggestionsPerKeyword The maximum number of keyword suggestions to return per specified keyword. If SuggestionType is set to 4, you can request a maximum of 200 suggestions per keyword; otherwise the maximum suggestions that you can request is 100.

The default is 50.
PublisherCountries The country codes of the countries/regions to use as the source of data for determining the suggested keywords.

You can specify one or more country codes. Each country that you specify must support the language that you specified in the Language element.

For supported values, see the Remarks section below.

The default is all countries/regions that support the specified language.
string array
RemoveDuplicates A Boolean value that determines whether to remove duplicate keywords from the list of suggested keywords. To remove duplicates, set to true. The default is false. boolean
SuggestionType The provider to use to generate the keyword suggestions. For a list of possible providers, the language and country restrictions of each provider, and the default provider by country, see the Remarks section below. int

Request Header Elements

Element Description Data Type
AuthenticationToken The OAuth access token that represents a Microsoft Account user who has permissions to Bing Ads accounts. string
CustomerAccountId The identifier of the account that owns the entities in the request. This header element must have the same value as the AccountId body element when both are required. string
CustomerId The identifier of the customer that contains and owns the account. If you manage an account of another customer, you should use that customer ID instead of your own customer ID. string
DeveloperToken The developer token used to access the Bing Ads API. string
Password The Bing Ads managed user's sign-in password. string
UserName The Bing Ads managed user's sign-in name. You must not set this element to a Microsoft account or email address. string


The UserName and Password header elements are deprecated. In future versions of the API, Bing Ads will transition exclusively to Microsoft Account (email address) authentication. For more information, see Authentication with OAuth. UserName and Password are still required for Bing Ads managed credentials, but they are not applicable for Microsoft account authentication. To authenticate a Microsoft account, use the AuthenticationToken] header instead of UserName and Password.


The CustomerAccountId and CustomerId are required for most service operations, and as a best practice you should always specify them in the request.

Response Elements

The SuggestKeywordsFromExistingKeywordsResponse object defines the body and header elements of the service operation response. The elements are returned in the same order as shown in the Response SOAP.

Response Body Elements

Element Description Data Type
KeywordSuggestions An array of KeywordSuggestion data objects. The array contains an item for each keyword specified in the request. The object contains a list of suggested keywords that may perform better than the specified keyword.

For each suggested keyword, the object includes a score that indicates the probability that using the keyword would result in an ad being included in the results of a search query. If there are no suggestions for a keyword, the SuggestionsAndConfidence element will be null.
KeywordSuggestion array

Response Header Elements

Element Description Data Type
TrackingId The identifier of the log entry that contains the details of the API call. string

Request SOAP

The following template shows the order of the body and header elements for the SOAP request.

<s:Envelope xmlns:i="" xmlns:s="">
  <s:Header xmlns="Microsoft.Advertiser.AdInsight.Api.Service.V11">
    <Action mustUnderstand="1">SuggestKeywordsFromExistingKeywords</Action>
    <ApplicationToken i:nil="false">ValueHere</ApplicationToken>
    <AuthenticationToken i:nil="false">ValueHere</AuthenticationToken>
    <CustomerAccountId i:nil="false">ValueHere</CustomerAccountId>
    <CustomerId i:nil="false">ValueHere</CustomerId>
    <DeveloperToken i:nil="false">ValueHere</DeveloperToken>
    <Password i:nil="false">ValueHere</Password>
    <UserName i:nil="false">ValueHere</UserName>
    <SuggestKeywordsFromExistingKeywordsRequest xmlns="Microsoft.Advertiser.AdInsight.Api.Service.V11">
      <Keywords i:nil="false" xmlns:a1="">
      <Language i:nil="false">ValueHere</Language>
      <PublisherCountries i:nil="false" xmlns:a1="">
      <MaxSuggestionsPerKeyword i:nil="false">ValueHere</MaxSuggestionsPerKeyword>
      <SuggestionType i:nil="false">ValueHere</SuggestionType>
      <RemoveDuplicates i:nil="false">ValueHere</RemoveDuplicates>
      <ExcludeBrand i:nil="false">ValueHere</ExcludeBrand>
      <AdGroupId i:nil="false">ValueHere</AdGroupId>
      <CampaignId i:nil="false">ValueHere</CampaignId>

Response SOAP

The following template shows the order of the body and header elements for the SOAP response.

<s:Envelope xmlns:s="">
  <s:Header xmlns="Microsoft.Advertiser.AdInsight.Api.Service.V11">
    <TrackingId d3p1:nil="false" xmlns:d3p1="">ValueHere</TrackingId>
    <SuggestKeywordsFromExistingKeywordsResponse xmlns="Microsoft.Advertiser.AdInsight.Api.Service.V11">
      <KeywordSuggestions xmlns:e404="" d4p1:nil="false" xmlns:d4p1="">
          <e404:Keyword d4p1:nil="false">ValueHere</e404:Keyword>
          <e404:SuggestionsAndConfidence d4p1:nil="false">
              <e404:SuggestedKeyword d4p1:nil="false">ValueHere</e404:SuggestedKeyword>

Code Syntax

The example syntax can be used with Bing Ads SDKs. See Bing Ads Code Examples for more examples.

public async Task<SuggestKeywordsFromExistingKeywordsResponse> SuggestKeywordsFromExistingKeywordsAsync(
    IList<string> keywords,
    string language,
    IList<string> publisherCountries,
    int? maxSuggestionsPerKeyword,
    int? suggestionType,
    bool? removeDuplicates,
    bool? excludeBrand,
    long? adGroupId,
    long? campaignId)
    var request = new SuggestKeywordsFromExistingKeywordsRequest
        Keywords = keywords,
        Language = language,
        PublisherCountries = publisherCountries,
        MaxSuggestionsPerKeyword = maxSuggestionsPerKeyword,
        SuggestionType = suggestionType,
        RemoveDuplicates = removeDuplicates,
        ExcludeBrand = excludeBrand,
        AdGroupId = adGroupId,
        CampaignId = campaignId

    return (await AdInsightService.CallAsync((s, r) => s.SuggestKeywordsFromExistingKeywordsAsync(r), request));
static SuggestKeywordsFromExistingKeywordsResponse suggestKeywordsFromExistingKeywords(
    ArrayOfstring keywords,
    java.lang.String language,
    ArrayOfstring publisherCountries,
    int maxSuggestionsPerKeyword,
    int suggestionType,
    boolean removeDuplicates,
    boolean excludeBrand,
    java.lang.Long adGroupId,
    java.lang.Long campaignId) throws RemoteException, Exception
    SuggestKeywordsFromExistingKeywordsRequest request = new SuggestKeywordsFromExistingKeywordsRequest();


    return AdInsightService.getService().suggestKeywordsFromExistingKeywords(request);
static function SuggestKeywordsFromExistingKeywords(

    $GLOBALS['Proxy'] = $GLOBALS['AdInsightProxy'];

    $request = new SuggestKeywordsFromExistingKeywordsRequest();

    $request->Keywords = $keywords;
    $request->Language = $language;
    $request->PublisherCountries = $publisherCountries;
    $request->MaxSuggestionsPerKeyword = $maxSuggestionsPerKeyword;
    $request->SuggestionType = $suggestionType;
    $request->RemoveDuplicates = $removeDuplicates;
    $request->ExcludeBrand = $excludeBrand;
    $request->AdGroupId = $adGroupId;
    $request->CampaignId = $campaignId;

    return $GLOBALS['AdInsightProxy']->GetService()->SuggestKeywordsFromExistingKeywords($request);


The following are the possible suggestion providers that you can specify.

Suggestion Type Description
1 Returns search queries that include the keyword.
2 Returns keywords from other ad groups that include the specified keyword.
3 Returns search queries that are related to the specified keyword.
4 Returns the best suggestions from the other providers.

The following are the providers that each country supports.


Service: AdInsightService.svc v11
Namespace: Microsoft.Advertiser.AdInsight.Api.Service.V11