GetEstimatedPositionByKeywords 服务操作 - Ad Insight
如果指定的出价值将用于指定的关键字,则获取搜索结果中的估计位置。 此外,该操作还提供点击次数的估算值、平均每次点击成本 (CPC) ,以及关键字可以使用估计出价生成的印象。
这些估计不是对未来性能的预测或保证。
注意
此操作适用于使用增强的 CPC 出价策略的搜索市场活动。
请求元素
GetEstimatedPositionByKeywordsRequest 对象定义服务操作请求的正文和标头元素。 元素的顺序必须与 请求 SOAP 中所示的顺序相同。
注意
除非下面另有说明,否则需要所有请求元素。
请求正文元素
元素 | 说明 | 数据类型 |
---|---|---|
AdGroupId | 广告组的标识符,其性能数据用于帮助确定关键字 (keyword) 在广告组上下文中的表现。 指定广告组有助于提高建议位置的准确性。 如果指定广告组,则必须指定它所属的营销活动。 |
long |
CampaignId | 拥有 AdGroupId 中指定的广告组的活动的标识符。 如果未指定广告组,市场活动的性能数据将用于帮助确定关键字 (keyword) 在市场活动上下文中的表现。 指定市场活动和广告组有助于提高建议位置的准确性。 如果未指定 AdGroupId 或 CampaignId,则操作将使用指定的 CustomerAccountId 标头元素来帮助确定关键字 (keyword) 在帐户上下文中的表现。 |
long |
CurrencyCode | 用于计算成本估算和建议出价值的货币单位的 ISO 代码。 如果未设置,服务将从 CustomerAccountId 标头元素中指定的帐户确定货币。 如果未设置 Currency 或 CustomerAccountId ,则服务将使用 USD。 |
CurrencyCode |
关键字 | 要根据指定的出价值获取搜索结果中估计位置的关键字数组。 最多可以指定 1,000 个关键字,每个关键字 (keyword) 最多可以包含 100 个字符。 | 字符串 数组 |
语言 | 与位置标识符并行使用的语言,用于估算位置。 在 LocationIds 中指定的每个位置都必须支持该语言。 有关可能的语言值,请参阅 广告语言。 如果未指定语言,服务操作将使用指定 AdGroupId 或 CampaignId 的语言。 如果未设置这些属性,则默认使用 EN (英语) 。 |
string |
LocationIds | 用于估计位置的地理位置的标识符。 所有位置都必须支持 Language 元素中指定的 语言 。 虽然可以指定多个位置标识符,但作为每个位置最准确的位置估计的最佳做法,每个服务调用只应指定一个位置。 有关可能的位置标识符,请参阅 地理位置代码。 如果未指定任何位置,服务操作将使用指定 AdGroupId 或 CampaignId 的位置条件。 如果未设置这些属性,则默认使用 190 (美国) 。 |
long 数组 |
MatchTypes | 要获取其估计值的唯一匹配类型的数组。 不能指定内容匹配类型。 |
MatchType 数组 |
MaxBid | 用于确定搜索结果中估计位置的最大出价值。 | 双 |
请求标头元素
元素 | 说明 | 数据类型 |
---|---|---|
AuthenticationToken | OAuth 访问令牌,表示有权Microsoft广告帐户的用户的凭据。 有关详细信息,请参阅 使用 OAuth 进行身份验证。 |
string |
CustomerAccountId | 拥有或与请求中的实体关联的广告帐户的标识符。 如果需要这两个元素,此标头元素必须与 AccountId 正文元素具有相同的值。 此元素是大多数服务操作所必需的,作为最佳做法,应始终设置它。 有关详细信息,请参阅 获取帐户和客户 ID。 |
string |
CustomerId | 用户正在访问或操作的客户) 经理帐户 (标识符。 用户可以访问多个经理帐户。 此元素是大多数服务操作所必需的,作为最佳做法,应始终设置它。 有关详细信息,请参阅 获取帐户和客户 ID。 |
string |
DeveloperToken | 用于访问必应广告 API 的开发人员令牌。 有关详细信息,请参阅 获取开发人员令牌。 |
string |
Password | 此元素保留供内部使用,将从 API 的未来版本中删除。 必须使用 AuthenticationToken 元素来设置用户凭据。 | string |
UserName | 此元素保留供内部使用,将从 API 的未来版本中删除。 必须使用 AuthenticationToken 元素来设置用户凭据。 | string |
响应元素
GetEstimatedPositionByKeywordsResponse 对象定义服务操作响应的正文和标头元素。 元素的返回顺序与 响应 SOAP 中所示的顺序相同。
响应正文元素
元素 | 说明 | 数据类型 |
---|---|---|
KeywordEstimatedPositions |
KeywordEstimatedPosition 数据对象的数组。 数组包含请求中指定的每个关键字 (keyword) 的项。 如果关键字 (keyword) 无效,则数组中的相应项将为 null。 如果数据可用于关键字 (keyword) ,则 EstimatedPositionAndTraffic 将根据指定的出价值提供搜索结果中可以显示广告的估计位置。 否则, EstimatedPositions 元素将设置为 null。 |
KeywordEstimatedPosition 数组 |
响应标头元素
元素 | 说明 | 数据类型 |
---|---|---|
跟踪 ID | 包含 API 调用详细信息的日志条目的标识符。 | string |
请求 SOAP
此模板由一个工具生成,用于显示 SOAP 请求的正文和标头元素的顺序。 有关可用于此服务操作的支持类型,请参阅上面的 请求正文元素 参考。
<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">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="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>
<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>
响应 SOAP
此模板由一个工具生成,用于显示 SOAP 响应的 正文 和 标头 元素的顺序。
<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>
<GetEstimatedPositionByKeywordsResponse xmlns="https://bingads.microsoft.com/AdInsight/v13">
<KeywordEstimatedPositions d4p1:nil="false" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">
<KeywordEstimatedPosition>
<Keyword d4p1:nil="false">ValueHere</Keyword>
<EstimatedPositions d4p1:nil="false">
<EstimatedPositionAndTraffic>
<MatchType>ValueHere</MatchType>
<MinClicksPerWeek>ValueHere</MinClicksPerWeek>
<MaxClicksPerWeek>ValueHere</MaxClicksPerWeek>
<AverageCPC>ValueHere</AverageCPC>
<MinImpressionsPerWeek>ValueHere</MinImpressionsPerWeek>
<MaxImpressionsPerWeek>ValueHere</MaxImpressionsPerWeek>
<CTR>ValueHere</CTR>
<MinTotalCostPerWeek>ValueHere</MinTotalCostPerWeek>
<MaxTotalCostPerWeek>ValueHere</MaxTotalCostPerWeek>
<CurrencyCode>ValueHere</CurrencyCode>
<EstimatedAdPosition>ValueHere</EstimatedAdPosition>
</EstimatedPositionAndTraffic>
</EstimatedPositions>
</KeywordEstimatedPosition>
</KeywordEstimatedPositions>
</GetEstimatedPositionByKeywordsResponse>
</s:Body>
</s:Envelope>
代码语法
示例语法可用于 必应广告 SDK。 有关更多示例,请参阅 必应广告 API 代码示例 。
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)
要求
服务: AdInsightService.svc v13
命名空间: https://bingads.microsoft.com/AdInsight/v13
请求 URL
https://adinsight.api.bingads.microsoft.com/AdInsight/v13/EstimatedPosition/QueryByKeywords
请求元素
GetEstimatedPositionByKeywordsRequest 对象定义服务操作请求的正文和标头元素。
注意
除非下面另有说明,否则需要所有请求元素。
请求正文元素
元素 | 说明 | 数据类型 |
---|---|---|
AdGroupId | 广告组的标识符,其性能数据用于帮助确定关键字 (keyword) 在广告组上下文中的表现。 指定广告组有助于提高建议位置的准确性。 如果指定广告组,则必须指定它所属的营销活动。 |
long |
CampaignId | 拥有 AdGroupId 中指定的广告组的活动的标识符。 如果未指定广告组,市场活动的性能数据将用于帮助确定关键字 (keyword) 在市场活动上下文中的表现。 指定市场活动和广告组有助于提高建议位置的准确性。 如果未指定 AdGroupId 或 CampaignId,则操作将使用指定的 CustomerAccountId 标头元素来帮助确定关键字 (keyword) 在帐户上下文中的表现。 |
long |
CurrencyCode | 用于计算成本估算和建议出价值的货币单位的 ISO 代码。 如果未设置,服务将从 CustomerAccountId 标头元素中指定的帐户确定货币。 如果未设置 Currency 或 CustomerAccountId ,则服务将使用 USD。 |
CurrencyCode |
关键字 | 要根据指定的出价值获取搜索结果中估计位置的关键字数组。 最多可以指定 1,000 个关键字,每个关键字 (keyword) 最多可以包含 100 个字符。 | 字符串 数组 |
语言 | 与位置标识符并行使用的语言,用于估算位置。 在 LocationIds 中指定的每个位置都必须支持该语言。 有关可能的语言值,请参阅 广告语言。 如果未指定语言,服务操作将使用指定 AdGroupId 或 CampaignId 的语言。 如果未设置这些属性,则默认使用 EN (英语) 。 |
string |
LocationIds | 用于估计位置的地理位置的标识符。 所有位置都必须支持 Language 元素中指定的 语言 。 虽然可以指定多个位置标识符,但作为每个位置最准确的位置估计的最佳做法,每个服务调用只应指定一个位置。 有关可能的位置标识符,请参阅 地理位置代码。 如果未指定任何位置,服务操作将使用指定 AdGroupId 或 CampaignId 的位置条件。 如果未设置这些属性,则默认使用 190 (美国) 。 |
long 数组 |
MatchTypes | 要获取其估计值的唯一匹配类型的数组。 不能指定内容匹配类型。 |
MatchType 数组 |
MaxBid | 用于确定搜索结果中估计位置的最大出价值。 | 双 |
请求标头元素
元素 | 说明 | 数据类型 |
---|---|---|
Authorization | OAuth 访问令牌,表示有权Microsoft广告帐户的用户的凭据。 请确保令牌的前缀为“持有者”,这是正确身份验证所必需的。 有关详细信息,请参阅 使用 OAuth 进行身份验证。 |
string |
CustomerAccountId | 拥有或与请求中的实体关联的广告帐户的标识符。 如果需要这两个元素,此标头元素必须与 AccountId 正文元素具有相同的值。 此元素是大多数服务操作所必需的,作为最佳做法,应始终设置它。 有关详细信息,请参阅 获取帐户和客户 ID。 |
string |
CustomerId | 用户正在访问或操作的客户) 经理帐户 (标识符。 用户可以访问多个经理帐户。 此元素是大多数服务操作所必需的,作为最佳做法,应始终设置它。 有关详细信息,请参阅 获取帐户和客户 ID。 |
string |
DeveloperToken | 用于访问必应广告 API 的开发人员令牌。 有关详细信息,请参阅 获取开发人员令牌。 |
string |
Password | 此元素保留供内部使用,将从 API 的未来版本中删除。 必须使用 AuthenticationToken 元素来设置用户凭据。 | string |
UserName | 此元素保留供内部使用,将从 API 的未来版本中删除。 必须使用 AuthenticationToken 元素来设置用户凭据。 | string |
响应元素
GetEstimatedPositionByKeywordsResponse 对象定义服务操作响应的正文和标头元素。 元素的返回顺序与 响应 JSON 中所示的顺序相同。
响应正文元素
元素 | 说明 | 数据类型 |
---|---|---|
KeywordEstimatedPositions |
KeywordEstimatedPosition 数据对象的数组。 数组包含请求中指定的每个关键字 (keyword) 的项。 如果关键字 (keyword) 无效,则数组中的相应项将为 null。 如果数据可用于关键字 (keyword) ,则 EstimatedPositionAndTraffic 将根据指定的出价值提供搜索结果中可以显示广告的估计位置。 否则, EstimatedPositions 元素将设置为 null。 |
KeywordEstimatedPosition 数组 |
响应标头元素
元素 | 说明 | 数据类型 |
---|---|---|
跟踪 ID | 包含 API 调用详细信息的日志条目的标识符。 | string |
请求 JSON
此模板由显示 JSON 请求的 正文 和 标头 元素的工具生成。 有关可用于此服务操作的支持类型,请参阅上面的 请求正文元素 参考。
{
"Keywords": [
"ValueHere"
],
"MaxBid": DoubleValueHere,
"Language": "ValueHere",
"LocationIds": [
"LongValueHere"
],
"CurrencyCode": "ValueHere",
"MatchTypes": [
"ValueHere"
],
"CampaignId": "LongValueHere",
"AdGroupId": "LongValueHere"
}
响应 JSON
此模板由一个工具生成,用于显示 JSON 响应的 正文 和 标头 元素。
{
"KeywordEstimatedPositions": [
{
"EstimatedPositions": [
{
"AverageCPC": DoubleValueHere,
"CTR": DoubleValueHere,
"CurrencyCode": "ValueHere",
"EstimatedAdPosition": DoubleValueHere,
"MatchType": "ValueHere",
"MaxClicksPerWeek": DoubleValueHere,
"MaxImpressionsPerWeek": "LongValueHere",
"MaxTotalCostPerWeek": DoubleValueHere,
"MinClicksPerWeek": DoubleValueHere,
"MinImpressionsPerWeek": "LongValueHere",
"MinTotalCostPerWeek": DoubleValueHere
}
],
"Keyword": "ValueHere"
}
]
}
代码语法
若要通过 SDK 调用 REST API,需要将 SDK 升级到特定版本并配置系统参数。示例语法可用于 必应广告 SDK。 有关更多示例,请参阅 必应广告 API 代码示例 。
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)