GetEstimatedBidByKeywords Service Operation - Ad Insight

Gets the estimated bid value of one or more keywords that could result in an ad appearing in the targeted position in the search results.

Note

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

Request Elements

The GetEstimatedBidByKeywordsRequest 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 bid.

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 bid. 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
EntityLevelBid Determines whether to return estimates for keyword level bids, ad group level bids, or both.

- Set EntityLevelBid to Keyword to get an array of KeywordEstimatedBid corresponding to the specified keywords.

- Set EntityLevelBid to AdGroup to get one EstimatedBidAndTraffic for the specified ad group.

- Set EntityLevelBid to AllEntities to get an array of KeywordEstimatedBid for keywords and one EstimatedBidAndTraffic for an ad group.

If you do not set EntityLevelBid, the default is to return only an array of KeywordEstimatedBid, or the equivalent of setting EntityLevelBid to Keyword.

If you set EntityLevelBid to any value other thanKeyword, AdGroup, or AllEntities, the service will return Code 3501 with ErrorCode CampaignServiceBidLevelInvalid.
string
Keywords A list of KeywordAndMatchType data objects for which you want to get suggested bid values. You may specify a maximum of 1,000 keywords, and each keyword can contain a maximum of 100 characters. KeywordAndMatchType array
Language The language used in parallel with location identifiers for estimating the bids.

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

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 bid 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
TargetPositionForAds The position where you want your ads to appear in the search results.

The default value is MainLine1.
TargetAdPosition

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 GetEstimatedBidByKeywordsResponse 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
AdGroupEstimatedBid Contains estimates of clicks, average cost per click (CPC), impressions, click-through rate (CTR), and total cost for the specified ad group if you would use the suggested bid.

The MatchType value within the EstimatedBidAndTraffic will always be Aggregate. In this context, it represents the default search bid for an ad group.
EstimatedBidAndTraffic
KeywordEstimatedBids An array of KeywordEstimatedBid 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.

Each KeywordEstimatedBid contains a keyword and EstimatedPositions element. If data is available for the keyword, the EstimatedPositionAndTraffic will provide the suggested bid value that could have resulted in an ad appearing in the targeted position of the search results. Otherwise, the EstimatedPositions element will be set to null.
KeywordEstimatedBid 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">GetEstimatedBidByKeywords</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>
    <GetEstimatedBidByKeywordsRequest xmlns="Microsoft.Advertiser.AdInsight.Api.Service.V12">
      <Keywords xmlns:e87="http://schemas.datacontract.org/2004/07/Microsoft.BingAds.Advertiser.AdInsight.Api.DataContract.V12.Message" i:nil="false">
        <e87:KeywordAndMatchType>
          <e87:KeywordText i:nil="false">ValueHere</e87:KeywordText>
          <e87:MatchTypes i:nil="false">
            <MatchType>ValueHere</MatchType>
          </e87:MatchTypes>
        </e87:KeywordAndMatchType>
      </Keywords>
      <TargetPositionForAds>ValueHere</TargetPositionForAds>
      <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>
      <CampaignId i:nil="false">ValueHere</CampaignId>
      <AdGroupId i:nil="false">ValueHere</AdGroupId>
      <EntityLevelBid i:nil="false">ValueHere</EntityLevelBid>
    </GetEstimatedBidByKeywordsRequest>
  </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>
    <GetEstimatedBidByKeywordsResponse xmlns="Microsoft.Advertiser.AdInsight.Api.Service.V12">
      <KeywordEstimatedBids xmlns:e88="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">
        <e88:KeywordEstimatedBid>
          <e88:Keyword d4p1:nil="false">ValueHere</e88:Keyword>
          <e88:EstimatedBids d4p1:nil="false">
            <e88:EstimatedBidAndTraffic>
              <e88:MinClicksPerWeek d4p1:nil="false">ValueHere</e88:MinClicksPerWeek>
              <e88:MaxClicksPerWeek d4p1:nil="false">ValueHere</e88:MaxClicksPerWeek>
              <e88:AverageCPC d4p1:nil="false">ValueHere</e88:AverageCPC>
              <e88:MinImpressionsPerWeek d4p1:nil="false">ValueHere</e88:MinImpressionsPerWeek>
              <e88:MaxImpressionsPerWeek d4p1:nil="false">ValueHere</e88:MaxImpressionsPerWeek>
              <e88:CTR d4p1:nil="false">ValueHere</e88:CTR>
              <e88:MinTotalCostPerWeek d4p1:nil="false">ValueHere</e88:MinTotalCostPerWeek>
              <e88:MaxTotalCostPerWeek d4p1:nil="false">ValueHere</e88:MaxTotalCostPerWeek>
              <e88:CurrencyCode>ValueHere</e88:CurrencyCode>
              <e88:MatchType>ValueHere</e88:MatchType>
              <e88:EstimatedMinBid>ValueHere</e88:EstimatedMinBid>
            </e88:EstimatedBidAndTraffic>
          </e88:EstimatedBids>
        </e88:KeywordEstimatedBid>
      </KeywordEstimatedBids>
      <AdGroupEstimatedBid xmlns:e89="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">
        <e89:MinClicksPerWeek d4p1:nil="false">ValueHere</e89:MinClicksPerWeek>
        <e89:MaxClicksPerWeek d4p1:nil="false">ValueHere</e89:MaxClicksPerWeek>
        <e89:AverageCPC d4p1:nil="false">ValueHere</e89:AverageCPC>
        <e89:MinImpressionsPerWeek d4p1:nil="false">ValueHere</e89:MinImpressionsPerWeek>
        <e89:MaxImpressionsPerWeek d4p1:nil="false">ValueHere</e89:MaxImpressionsPerWeek>
        <e89:CTR d4p1:nil="false">ValueHere</e89:CTR>
        <e89:MinTotalCostPerWeek d4p1:nil="false">ValueHere</e89:MinTotalCostPerWeek>
        <e89:MaxTotalCostPerWeek d4p1:nil="false">ValueHere</e89:MaxTotalCostPerWeek>
        <e89:CurrencyCode>ValueHere</e89:CurrencyCode>
        <e89:MatchType>ValueHere</e89:MatchType>
        <e89:EstimatedMinBid>ValueHere</e89:EstimatedMinBid>
      </AdGroupEstimatedBid>
    </GetEstimatedBidByKeywordsResponse>
  </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<GetEstimatedBidByKeywordsResponse> GetEstimatedBidByKeywordsAsync(
	IList<KeywordAndMatchType> keywords,
	TargetAdPosition targetPositionForAds,
	string language,
	IList<long> locationIds,
	CurrencyCode? currencyCode,
	long? campaignId,
	long? adGroupId,
	string entityLevelBid)
{
	var request = new GetEstimatedBidByKeywordsRequest
	{
		Keywords = keywords,
		TargetPositionForAds = targetPositionForAds,
		Language = language,
		LocationIds = locationIds,
		CurrencyCode = currencyCode,
		CampaignId = campaignId,
		AdGroupId = adGroupId,
		EntityLevelBid = entityLevelBid
	};

	return (await AdInsightService.CallAsync((s, r) => s.GetEstimatedBidByKeywordsAsync(r), request));
}
static GetEstimatedBidByKeywordsResponse getEstimatedBidByKeywords(
	ArrayOfKeywordAndMatchType keywords,
	TargetAdPosition targetPositionForAds,
	java.lang.String language,
	ArrayOflong locationIds,
	CurrencyCode currencyCode,
	java.lang.Long campaignId,
	java.lang.Long adGroupId,
	java.lang.String entityLevelBid) throws RemoteException, Exception
{
	GetEstimatedBidByKeywordsRequest request = new GetEstimatedBidByKeywordsRequest();

	request.setKeywords(keywords);
	request.setTargetPositionForAds(targetPositionForAds);
	request.setLanguage(language);
	request.setLocationIds(locationIds);
	request.setCurrencyCode(currencyCode);
	request.setCampaignId(campaignId);
	request.setAdGroupId(adGroupId);
	request.setEntityLevelBid(entityLevelBid);

	return AdInsightService.getService().getEstimatedBidByKeywords(request);
}
static function GetEstimatedBidByKeywords(
	$keywords,
	$targetPositionForAds,
	$language,
	$locationIds,
	$currencyCode,
	$campaignId,
	$adGroupId,
	$entityLevelBid)
{

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

	$request = new GetEstimatedBidByKeywordsRequest();

	$request->Keywords = $keywords;
	$request->TargetPositionForAds = $targetPositionForAds;
	$request->Language = $language;
	$request->LocationIds = $locationIds;
	$request->CurrencyCode = $currencyCode;
	$request->CampaignId = $campaignId;
	$request->AdGroupId = $adGroupId;
	$request->EntityLevelBid = $entityLevelBid;

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

Requirements

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