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.

Note

Unless otherwise noted below, all request elements are required.

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
long
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
long
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.

Possible case-sensitive values are English, French, and German. See the Remarks section below for a list of providers that are supported for each language.

The default is English.
string
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.
int
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/region 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/region restrictions of each provider, and the default provider by country/region, see the Remarks section below. int

Request Header Elements

Element Description Data Type
AuthenticationToken The OAuth access token that represents the credentials of a user who has permissions to Microsoft Advertising accounts.

For more information see Authentication with OAuth.
string
CustomerAccountId The identifier of the ad account that owns or is associated with the entities in the request. This header element must have the same value as the AccountId body element when both are required. This element is required for most service operations, and as a best practice you should always set it.

For more information see Get Your Account and Customer IDs.
string
CustomerId The identifier of the manager account (customer) the user is accessing or operating from. A user can have access to multiple manager accounts. This element is required for most service operations, and as a best practice you should always set it.

For more information see Get Your Account and Customer IDs.
string
DeveloperToken The developer token used to access the Bing Ads API.

For more information see Get a Developer Token.
string
Password This element is reserved for internal use and will be removed from a future version of the API. You must use the AuthenticationToken element to set user credentials. string
UserName This element is reserved for internal use and will be removed from a future version of the API. You must use the AuthenticationToken element to set user credentials. string

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

This template was generated by a tool to show the order of the body and header elements for the SOAP request. For supported types that you can use with this service operation, see the Request Body Elements reference above.

<s:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header xmlns="https://bingads.microsoft.com/AdInsight/v13">
    <Action mustUnderstand="1">SuggestKeywordsFromExistingKeywords</Action>
    <AuthenticationToken i:nil="false">ValueHere</AuthenticationToken>
    <CustomerAccountId i:nil="false">ValueHere</CustomerAccountId>
    <CustomerId i:nil="false">ValueHere</CustomerId>
    <DeveloperToken i:nil="false">ValueHere</DeveloperToken>
  </s:Header>
  <s:Body>
    <SuggestKeywordsFromExistingKeywordsRequest xmlns="https://bingads.microsoft.com/AdInsight/v13">
      <Keywords i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <a1:string>ValueHere</a1:string>
      </Keywords>
      <Language i:nil="false">ValueHere</Language>
      <PublisherCountries i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <a1:string>ValueHere</a1:string>
      </PublisherCountries>
      <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>
    </SuggestKeywordsFromExistingKeywordsRequest>
  </s:Body>
</s:Envelope>

Response SOAP

This template was generated by a tool to show the order of the body and header elements for the SOAP response.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header xmlns="https://bingads.microsoft.com/AdInsight/v13">
    <TrackingId d3p1:nil="false" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance">ValueHere</TrackingId>
  </s:Header>
  <s:Body>
    <SuggestKeywordsFromExistingKeywordsResponse xmlns="https://bingads.microsoft.com/AdInsight/v13">
      <KeywordSuggestions d4p1:nil="false" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">
        <KeywordSuggestion>
          <Keyword d4p1:nil="false">ValueHere</Keyword>
          <SuggestionsAndConfidence d4p1:nil="false">
            <KeywordAndConfidence>
              <SuggestedKeyword d4p1:nil="false">ValueHere</SuggestedKeyword>
              <ConfidenceScore>ValueHere</ConfidenceScore>
            </KeywordAndConfidence>
          </SuggestionsAndConfidence>
        </KeywordSuggestion>
      </KeywordSuggestions>
    </SuggestKeywordsFromExistingKeywordsResponse>
  </s:Body>
</s:Envelope>

Code Syntax

The example syntax can be used with Bing Ads SDKs. See Bing Ads API 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();

	request.setKeywords(keywords);
	request.setLanguage(language);
	request.setPublisherCountries(publisherCountries);
	request.setMaxSuggestionsPerKeyword(maxSuggestionsPerKeyword);
	request.setSuggestionType(suggestionType);
	request.setRemoveDuplicates(removeDuplicates);
	request.setExcludeBrand(excludeBrand);
	request.setAdGroupId(adGroupId);
	request.setCampaignId(campaignId);

	return AdInsightService.getService().suggestKeywordsFromExistingKeywords(request);
}
static function SuggestKeywordsFromExistingKeywords(
	$keywords,
	$language,
	$publisherCountries,
	$maxSuggestionsPerKeyword,
	$suggestionType,
	$removeDuplicates,
	$excludeBrand,
	$adGroupId,
	$campaignId)
{

	$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);
}
response=adinsight_service.SuggestKeywordsFromExistingKeywords(
	Keywords=Keywords,
	Language=Language,
	PublisherCountries=PublisherCountries,
	MaxSuggestionsPerKeyword=MaxSuggestionsPerKeyword,
	SuggestionType=SuggestionType,
	RemoveDuplicates=RemoveDuplicates,
	ExcludeBrand=ExcludeBrand,
	AdGroupId=AdGroupId,
	CampaignId=CampaignId)

Remarks

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/region supports.

Country/Region Language Supported Provider Types Default Provider Type
Australia (AU) English 2,3,4 4
Canada (CA) English 2,3,4 4
France (FR) French 2,3,4 4
Germany (DE) German 1,2,3,4 4

Requirements

Service: AdInsightService.svc v13
Namespace: https://bingads.microsoft.com/AdInsight/v13