GetEstimatedPositionByKeywords Service Operation - Ad Insight

Gets the estimated position in the search results if the specified bid value would be used for the specified keywords. In addition, the operation provides estimates of clicks, average cost per click (CPC), and impressions that the keywords could be generated with the estimated bid.

Note

The estimates are not a prediction or guarantee of future performance.

Request Elements

The GetEstimatedPositionByKeywordsRequest 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 whose performance data is used to help determine how well the keyword might perform in the context of the ad group. Specifying an ad group helps improve the accuracy of the suggested position.

If you specify an ad group, you must specify the campaign that it belongs to.
long
CampaignId The identifier of the campaign that owns the ad group specified in AdGroupId. If you do not specify an ad group, the campaign's performance data is used to help determine how well the keyword might perform in the context of the campaign.

Specifying a campaign and ad group helps improve the accuracy of the suggested position. If neither AdGroupId or CampaignId are specified, the operation uses the specified CustomerAccountId header element to help determine how well the keyword might perform in the context of the account.
long
CurrencyCode The ISO code for the monetary unit to use to calculate the cost estimates and suggested bid value.

If not set, the service determines the currency from the account specified in the CustomerAccountId header element. If neither Currency or CustomerAccountId is set, the service uses USD.
CurrencyCode
Keywords An array of keywords for which you want to get the estimated position in the search results, based on the specified bid value. You may specify a maximum of 1,000 keywords and each keyword can contains a maximum of 100 characters. string array
Language The language used in parallel with location identifiers for estimating the position.

The language must be supported in each of the locations that you specify in LocationIds.

For possible language values, see Ad Languages.

If you do not specify the language, the service operation uses the language of the specified AdGroupId or CampaignId. If none of these properties are set, then EN (English) is used by default.
string
LocationIds The identifier or identifiers of the geographical locations to use for estimating the position.

All of the locations must support the language specified in the Language element. Although you can specify multiple location identifiers, as a best practice for the most accurate position estimates per location, you should specify only one location per service call.

For possible location identifiers, see Geographical Location Codes.

If you do not specify any locations, the service operation uses the location criterions of the specified AdGroupId or CampaignId. If none of these properties are set, then 190 (United States) is used by default.
long array
MatchTypes An array of unique match types for which you want to get estimates.

You may not specify the Content match type.
MatchType array
MaxBid The maximum bid value to use to determine the estimated position in the search results. double

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

Note

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 GetEstimatedPositionByKeywordsResponse 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
KeywordEstimatedPositions An array of KeywordEstimatedPosition data objects. The array contains an item for each keyword specified in the request. If the keyword is not valid, the corresponding item in the array will be null.

If data is available for the keyword, the EstimatedPositionAndTraffic will provide the estimated position in the search results where your ads could appear, based on the specified bid value. Otherwise, the EstimatedPositions element will be set to null.
KeywordEstimatedPosition 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="Microsoft.Advertiser.AdInsight.Api.Service.V12">
    <Action mustUnderstand="1">GetEstimatedPositionByKeywords</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>
    <GetEstimatedPositionByKeywordsRequest xmlns="Microsoft.Advertiser.AdInsight.Api.Service.V12">
      <Keywords i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <a1:string>ValueHere</a1:string>
      </Keywords>
      <MaxBid>ValueHere</MaxBid>
      <Language i:nil="false">ValueHere</Language>
      <LocationIds i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <a1:long>ValueHere</a1:long>
      </LocationIds>
      <CurrencyCode i:nil="false">ValueHere</CurrencyCode>
      <MatchTypes i:nil="false">
        <MatchType>ValueHere</MatchType>
      </MatchTypes>
      <CampaignId i:nil="false">ValueHere</CampaignId>
      <AdGroupId i:nil="false">ValueHere</AdGroupId>
    </GetEstimatedPositionByKeywordsRequest>
  </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="Microsoft.Advertiser.AdInsight.Api.Service.V12">
    <TrackingId d3p1:nil="false" xmlns:d3p1="http://www.w3.org/2001/XMLSchema-instance">ValueHere</TrackingId>
  </s:Header>
  <s:Body>
    <GetEstimatedPositionByKeywordsResponse xmlns="Microsoft.Advertiser.AdInsight.Api.Service.V12">
      <KeywordEstimatedPositions xmlns:e91="http://schemas.datacontract.org/2004/07/Microsoft.BingAds.Advertiser.AdInsight.Api.DataContract.V12.Entity" d4p1:nil="false" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">
        <e91:KeywordEstimatedPosition>
          <e91:Keyword d4p1:nil="false">ValueHere</e91:Keyword>
          <e91:EstimatedPositions d4p1:nil="false">
            <e91:EstimatedPositionAndTraffic>
              <e91:MatchType>ValueHere</e91:MatchType>
              <e91:MinClicksPerWeek>ValueHere</e91:MinClicksPerWeek>
              <e91:MaxClicksPerWeek>ValueHere</e91:MaxClicksPerWeek>
              <e91:AverageCPC>ValueHere</e91:AverageCPC>
              <e91:MinImpressionsPerWeek>ValueHere</e91:MinImpressionsPerWeek>
              <e91:MaxImpressionsPerWeek>ValueHere</e91:MaxImpressionsPerWeek>
              <e91:CTR>ValueHere</e91:CTR>
              <e91:MinTotalCostPerWeek>ValueHere</e91:MinTotalCostPerWeek>
              <e91:MaxTotalCostPerWeek>ValueHere</e91:MaxTotalCostPerWeek>
              <e91:CurrencyCode>ValueHere</e91:CurrencyCode>
              <e91:EstimatedAdPosition>ValueHere</e91:EstimatedAdPosition>
            </e91:EstimatedPositionAndTraffic>
          </e91:EstimatedPositions>
        </e91:KeywordEstimatedPosition>
      </KeywordEstimatedPositions>
    </GetEstimatedPositionByKeywordsResponse>
  </s:Body>
</s:Envelope>

Code Syntax

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

public async Task<GetEstimatedPositionByKeywordsResponse> GetEstimatedPositionByKeywordsAsync(
	IList<string> keywords,
	double maxBid,
	string language,
	IList<long> locationIds,
	CurrencyCode? currencyCode,
	IList<MatchType> matchTypes,
	long? campaignId,
	long? adGroupId)
{
	var request = new GetEstimatedPositionByKeywordsRequest
	{
		Keywords = keywords,
		MaxBid = maxBid,
		Language = language,
		LocationIds = locationIds,
		CurrencyCode = currencyCode,
		MatchTypes = matchTypes,
		CampaignId = campaignId,
		AdGroupId = adGroupId
	};

	return (await AdInsightService.CallAsync((s, r) => s.GetEstimatedPositionByKeywordsAsync(r), request));
}
static GetEstimatedPositionByKeywordsResponse getEstimatedPositionByKeywords(
	ArrayOfstring keywords,
	double maxBid,
	java.lang.String language,
	ArrayOflong locationIds,
	CurrencyCode currencyCode,
	ArrayOfMatchType matchTypes,
	java.lang.Long campaignId,
	java.lang.Long adGroupId) throws RemoteException, Exception
{
	GetEstimatedPositionByKeywordsRequest request = new GetEstimatedPositionByKeywordsRequest();

	request.setKeywords(keywords);
	request.setMaxBid(maxBid);
	request.setLanguage(language);
	request.setLocationIds(locationIds);
	request.setCurrencyCode(currencyCode);
	request.setMatchTypes(matchTypes);
	request.setCampaignId(campaignId);
	request.setAdGroupId(adGroupId);

	return AdInsightService.getService().getEstimatedPositionByKeywords(request);
}
static function GetEstimatedPositionByKeywords(
	$keywords,
	$maxBid,
	$language,
	$locationIds,
	$currencyCode,
	$matchTypes,
	$campaignId,
	$adGroupId)
{

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

	$request = new GetEstimatedPositionByKeywordsRequest();

	$request->Keywords = $keywords;
	$request->MaxBid = $maxBid;
	$request->Language = $language;
	$request->LocationIds = $locationIds;
	$request->CurrencyCode = $currencyCode;
	$request->MatchTypes = $matchTypes;
	$request->CampaignId = $campaignId;
	$request->AdGroupId = $adGroupId;

	return $GLOBALS['AdInsightProxy']->GetService()->GetEstimatedPositionByKeywords($request);
}
response=adinsight_service.GetEstimatedPositionByKeywords(
	Keywords=Keywords,
	MaxBid=MaxBid,
	Language=Language,
	LocationIds=LocationIds,
	CurrencyCode=CurrencyCode,
	MatchTypes=MatchTypes,
	CampaignId=CampaignId,
	AdGroupId=AdGroupId)

Requirements

Service: AdInsightService.svc v12
Namespace: Microsoft.Advertiser.AdInsight.Api.Service.V12