SuggestKeywordsForUrl Service Operation - Ad Insight

Suggests the possible keywords for the content located at the specified URL.

Request Elements

The SuggestKeywordsForUrlRequest 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
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
Language The language used by the website.

For possible values, see Ad Languages.

The default is English.
MaxKeywords A positive integer value that specifies the maximum number of keywords to return. The maximum value that you can specify is 800.

The default is 10.
MinConfidenceScore A filter value that limits the keywords that the service returns to those that have a confidence score that is greater than or equal to the specified score. For example, you can specify that you want the operation to return only keywords that have a confidence score of at least 80 percent (0.8).

If null, the confidence score is not used to limit the results.
Url The URL of the webpage to scan for possible keywords. The URL can contain a maximum of 2,000 characters. string

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 SuggestKeywordsForUrlResponse 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
Keywords An array of KeywordAndConfidence objects that contains the possible keywords found in the content of the specified URL. In addition, the object includes a score that indicates the probability that using the keyword would result in the URL being included in the results of a search query.

The results are sorted in order from keywords with the highest confidence score to those with the lowest confidence score.
KeywordAndConfidence 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">SuggestKeywordsForUrl</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>
    <SuggestKeywordsForUrlRequest xmlns="Microsoft.Advertiser.AdInsight.Api.Service.V11">
      <Url i:nil="false">ValueHere</Url>
      <Language i:nil="false">ValueHere</Language>
      <MaxKeywords i:nil="false">ValueHere</MaxKeywords>
      <MinConfidenceScore i:nil="false">ValueHere</MinConfidenceScore>
      <ExcludeBrand i:nil="false">ValueHere</ExcludeBrand>

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>
    <SuggestKeywordsForUrlResponse xmlns="Microsoft.Advertiser.AdInsight.Api.Service.V11">
      <Keywords xmlns:e403="" d4p1:nil="false" xmlns:d4p1="">
          <e403:SuggestedKeyword d4p1:nil="false">ValueHere</e403:SuggestedKeyword>

Code Syntax

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

public async Task<SuggestKeywordsForUrlResponse> SuggestKeywordsForUrlAsync(
    string url,
    string language,
    int? maxKeywords,
    double? minConfidenceScore,
    bool? excludeBrand)
    var request = new SuggestKeywordsForUrlRequest
        Url = url,
        Language = language,
        MaxKeywords = maxKeywords,
        MinConfidenceScore = minConfidenceScore,
        ExcludeBrand = excludeBrand

    return (await AdInsightService.CallAsync((s, r) => s.SuggestKeywordsForUrlAsync(r), request));
static SuggestKeywordsForUrlResponse suggestKeywordsForUrl(
    java.lang.String url,
    java.lang.String language,
    int maxKeywords,
    double minConfidenceScore,
    boolean excludeBrand) throws RemoteException, Exception
    SuggestKeywordsForUrlRequest request = new SuggestKeywordsForUrlRequest();


    return AdInsightService.getService().suggestKeywordsForUrl(request);
static function SuggestKeywordsForUrl(

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

    $request = new SuggestKeywordsForUrlRequest();

    $request->Url = $url;
    $request->Language = $language;
    $request->MaxKeywords = $maxKeywords;
    $request->MinConfidenceScore = $minConfidenceScore;
    $request->ExcludeBrand = $excludeBrand;

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


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