次の方法で共有


GetHistoricalSearchCount サービス操作 - Ad Insight

指定した期間に正規化された用語が検索で使用された回数を取得します。 結果はデバイスの種類別に集計されます。

Request 要素

GetHistoricalSearchCountRequest オブジェクトは、サービス操作要求の本文要素とヘッダー要素を定義します。 要素は、 要求 SOAP に示されている順序と同じ順序である必要があります。

注:

以下に特に記載がない限り、すべての要求要素が必要です。

要求本文要素

要素 説明 データ型
デバイス コンピューター、非スマートフォン、スマートフォン、タブレットの 1 つ以上のデバイスの種類の一覧。 既定値は [コンピューター] です。

応答には、使用可能な場合にのみ指定したデバイスの種類の検索カウントが含まれます。
string 配列
EndDate 履歴検索数を決定するために使用するデータを識別する日付範囲の終了日。

日付を今日の日付より後にすることはできません。また、指定した開始日より後の日付または同じ日付にする必要があります。

指定した TimePeriodRollup が [週単位] または [月単位] の場合は、有効な終了日を調整できます。
DayMonthAndYear
キーワード 検索クエリでキーワード (keyword)が使用された回数を決定するキーワードの配列。 配列には最大 1,000 個のキーワードを含めることができます。各キーワード (keyword)には最大 100 文字を含めることができます。 string 配列
言語 キーワードが書き込まれる言語。

PublisherCountries 要素で指定する国/地域は、指定した言語をサポートしている必要があります。

使用可能な値については、「 サポートされている言語」を参照してください。
string
PublisherCountries 履歴データのソースとして使用する国/地域の国コード。

1 つ以上の国コードを指定できます。 指定する各国/地域は、 Language 要素で指定された言語をサポートする必要があります。

使用可能な値については、「 広告言語」を参照してください。

Null の場合、既定値は指定した言語をサポートするすべての国/地域です。
string 配列
StartDate 履歴検索数を決定するために使用するデータを識別する日付範囲の開始日。

この日付は、指定した終了日より前か、指定した終了日と同じである必要があります。 日付は、指定した TimePeriodRollup 要素に対応する使用可能な最大履歴データ範囲より後にする必要があります。

指定した TimePeriodRollup が [週単位] または [月単位] の場合は、有効な開始日を調整できます。
DayMonthAndYear
TimePeriodRollup 日単位、週単位、月単位のどちらで集計されたデータを返すかを指定できます。

サポートされている値の一覧については、以下の 「解説 」セクションを参照してください。
string

要求ヘッダー要素

要素 説明 データ型
AuthenticationToken Microsoft Advertising アカウントへのアクセス許可を持つユーザーの資格情報を表す OAuth アクセス トークン。

詳細については、「 OAuth による認証」を参照してください。
string
CustomerAccountId 要求のエンティティを所有または関連付けられている広告アカウントの識別子。 両方が必要な場合、このヘッダー要素の値は AccountId 本文要素と同じである必要があります。 この要素は、ほとんどのサービス操作に必要であり、ベスト プラクティスとして常に設定する必要があります。

詳細については、「 アカウントと顧客 ID を取得する」を参照してください。
string
Customerid ユーザーがアクセスまたは操作しているマネージャー アカウント (顧客) の識別子。 ユーザーは複数のマネージャー アカウントにアクセスできます。 この要素は、ほとんどのサービス操作に必要であり、ベスト プラクティスとして常に設定する必要があります。

詳細については、「 アカウントと顧客 ID を取得する」を参照してください。
string
DeveloperToken Bing Ads API へのアクセスに使用される開発者トークン。

詳細については、「 開発者トークンを取得する」を参照してください。
string
Password この要素は内部使用のために予約されており、今後のバージョンの API から削除されます。 ユーザー資格情報を設定するには、AuthenticationToken 要素を使用する必要があります。 string
UserName この要素は内部使用のために予約されており、今後のバージョンの API から削除されます。 ユーザー資格情報を設定するには、AuthenticationToken 要素を使用する必要があります。 string

Response 要素

GetHistoricalSearchCountResponse オブジェクトは、サービス操作応答の本文要素とヘッダー要素を定義します。 要素は、 応答 SOAP に示されている順序と同じ順序で返されます。

応答本文の要素

要素 説明 データ型
KeywordSearchCounts KeywordSearchCount データ オブジェクトの配列。 配列には、要求で指定された各キーワード (keyword)の項目が含まれています。 キーワード (keyword)が無効な場合、配列内の対応する項目は null になります。

KeywordSearchCount には、 SearchCountsByAttributes の配列が含まれています。 配列には、要求で指定された一意のデバイスごとに項目が含まれます。
KeywordSearchCount 配列

応答ヘッダー要素

要素 説明 データ型
TrackingId 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">GetHistoricalSearchCount</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>
    <GetHistoricalSearchCountRequest 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>
      <StartDate i:nil="false">
        <Day>ValueHere</Day>
        <Month>ValueHere</Month>
        <Year>ValueHere</Year>
      </StartDate>
      <EndDate i:nil="false">
        <Day>ValueHere</Day>
        <Month>ValueHere</Month>
        <Year>ValueHere</Year>
      </EndDate>
      <TimePeriodRollup i:nil="false">ValueHere</TimePeriodRollup>
      <Devices i:nil="false" xmlns:a1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <a1:string>ValueHere</a1:string>
      </Devices>
    </GetHistoricalSearchCountRequest>
  </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>
    <GetHistoricalSearchCountResponse xmlns="https://bingads.microsoft.com/AdInsight/v13">
      <KeywordSearchCounts d4p1:nil="false" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">
        <KeywordSearchCount>
          <Keyword d4p1:nil="false">ValueHere</Keyword>
          <SearchCountsByAttributes d4p1:nil="false">
            <SearchCountsByAttributes>
              <Device d4p1:nil="false">ValueHere</Device>
              <HistoricalSearchCounts d4p1:nil="false">
                <HistoricalSearchCountPeriodic>
                  <SearchCount>ValueHere</SearchCount>
                  <DayMonthAndYear d4p1:nil="false">
                    <Day>ValueHere</Day>
                    <Month>ValueHere</Month>
                    <Year>ValueHere</Year>
                  </DayMonthAndYear>
                </HistoricalSearchCountPeriodic>
              </HistoricalSearchCounts>
            </SearchCountsByAttributes>
          </SearchCountsByAttributes>
        </KeywordSearchCount>
      </KeywordSearchCounts>
    </GetHistoricalSearchCountResponse>
  </s:Body>
</s:Envelope>

コード構文

構文の例は、 Bing広告 SDK で使用できます。 その他 の例については、「Bing広告 API コードの例 」を参照してください。

public async Task<GetHistoricalSearchCountResponse> GetHistoricalSearchCountAsync(
	IList<string> keywords,
	string language,
	IList<string> publisherCountries,
	DayMonthAndYear startDate,
	DayMonthAndYear endDate,
	string timePeriodRollup,
	IList<string> devices)
{
	var request = new GetHistoricalSearchCountRequest
	{
		Keywords = keywords,
		Language = language,
		PublisherCountries = publisherCountries,
		StartDate = startDate,
		EndDate = endDate,
		TimePeriodRollup = timePeriodRollup,
		Devices = devices
	};

	return (await AdInsightService.CallAsync((s, r) => s.GetHistoricalSearchCountAsync(r), request));
}
static GetHistoricalSearchCountResponse getHistoricalSearchCount(
	ArrayOfstring keywords,
	java.lang.String language,
	ArrayOfstring publisherCountries,
	DayMonthAndYear startDate,
	DayMonthAndYear endDate,
	java.lang.String timePeriodRollup,
	ArrayOfstring devices) throws RemoteException, Exception
{
	GetHistoricalSearchCountRequest request = new GetHistoricalSearchCountRequest();

	request.setKeywords(keywords);
	request.setLanguage(language);
	request.setPublisherCountries(publisherCountries);
	request.setStartDate(startDate);
	request.setEndDate(endDate);
	request.setTimePeriodRollup(timePeriodRollup);
	request.setDevices(devices);

	return AdInsightService.getService().getHistoricalSearchCount(request);
}
static function GetHistoricalSearchCount(
	$keywords,
	$language,
	$publisherCountries,
	$startDate,
	$endDate,
	$timePeriodRollup,
	$devices)
{

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

	$request = new GetHistoricalSearchCountRequest();

	$request->Keywords = $keywords;
	$request->Language = $language;
	$request->PublisherCountries = $publisherCountries;
	$request->StartDate = $startDate;
	$request->EndDate = $endDate;
	$request->TimePeriodRollup = $timePeriodRollup;
	$request->Devices = $devices;

	return $GLOBALS['AdInsightProxy']->GetService()->GetHistoricalSearchCount($request);
}
response=adinsight_service.GetHistoricalSearchCount(
	Keywords=Keywords,
	Language=Language,
	PublisherCountries=PublisherCountries,
	StartDate=StartDate,
	EndDate=EndDate,
	TimePeriodRollup=TimePeriodRollup,
	Devices=Devices)

注釈

次の大文字と小文字を区別する値を指定できます。データは、対応する使用可能な最大履歴データ範囲まで戻されます。

TimePeriodRollup 使用可能な履歴データ
毎日 直近の完了日の 45 日前まで。
Weekly (週単位) 直近の完了週の 15 週間前まで。

指定した StartDate は最も近い日曜日に調整され、 EndDate は最も近い土曜日に前方に調整されます。
毎月 直近の完了月の 24 か月前まで。

指定した StartDate は月の初めに調整され、 EndDate は月の終わりまで調整されます。

サポートされている言語

言語要求本文要素でサポートされている 言語 を次に示します。

サポートされている言語
デンマーク語
オランダ語
英語
フィンランド語
フランス語
ドイツ語
イタリア語
ノルウェー語
ポルトガル語
SimplifiedChinese
スペイン語
スウェーデン語
TraditionalChinese

言語と国/地域のマッピング

言語と国/地域マッピングの表を次に示します。

言語 CountryCode 国/地域設定 Language@Country
デンマーク語 DK デンマーク Danish@Denmark
オランダ語 NL オランダ Dutch@Netherlands
英語 Au オーストラリア English@Australia
英語 CA カナダ English@Canada
英語 FR フランス English@France
英語 DE ドイツ English@Germany
英語 IN インド English@India
英語 ID インドネシア English@Indonesia
英語 IE アイルランド English@Ireland
英語 IT イタリア English@Italy
英語 私の マレーシア English@Malaysia
英語 NL オランダ English@Netherlands
英語 Nz ニュージーランド English@NewZealand
英語 PH フィリピン English@Philippines
英語 Sg シンガポール English@Singapore
英語 Es スペイン English@Spain
英語 SE スウェーデン English@Sweden
英語 Ch スイス English@Switzerland
英語 番目 タイ English@Thailand
英語 Gb 英国 English@UK
英語 US 米国 English@US
英語 Vn ベトナム English@Vietnam
フィンランド語 FI フィンランド Finnish@Finland
フランス語 CA カナダ French@Canada
フランス語 FR フランス French@France
フランス語 Ch スイス French@Switzerland
フランス語 Gb 英国 French@UK
フランス語 US 米国 French@US
ドイツ語 Au オーストラリア German@Australia
ドイツ語 AT オーストリア German@Austria
ドイツ語 CA カナダ German@Canada
ドイツ語 FR フランス German@France
ドイツ語 DE ドイツ German@Germany
ドイツ語 Ch スイス German@Switzerland
ドイツ語 Gb 英国 German@UK
ドイツ語 US 米国 German@US
イタリア語 IT イタリア Italian@Italy
ノルウェー語 動作しない ノルウェー Norwegian@Norway
ポルトガル語 Br ブラジル Portuguese@Brazil
SimplifiedChinese Cn 中国 SimplifiedChinese@China
スペイン語 Ar アルゼンチン Spanish@Argentina
スペイン語 Cl チリ Spanish@Chile
スペイン語 共同 コロンビア Spanish@Colombia
スペイン語 MX メキシコ Spanish@Mexico
スペイン語 Pe ペルー Spanish@Peru
スペイン語 Es スペイン Spanish@Spain
スペイン語 US US Spanish@US
スペイン語 Ve ベネズエラ Spanish@Venezuela
スウェーデン語 SE スウェーデン Swedish@Sweden
TraditionalChinese Hk HongKongSAR TraditionalChinese@HongKongSAR
TraditionalChinese Tw 台湾 TraditionalChinese@Taiwan

要件

サービス: AdInsightService.svc v13
名前 空間: https://bingads.microsoft.com/AdInsight/v13