> ## Documentation Index
> Fetch the complete documentation index at: https://docs.x.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 概要

> v2 の Post counts エンドポイントは、最終的に Enterprise Search API の counts エンドポイントを置き換えます。migrate を扱う X API v2 スタンダードティアのリファレンス。

## X API の Post counts エンドポイントを比較する

v2 の Post counts エンドポイントは、最終的に [Enterprise Search API の counts エンドポイント](/x-api/enterprise-gnip-2.0/fundamentals/search-api#counts-requests-post-count)を置き換えます。旧バージョンの Post counts エンドポイントを使用したコード、アプリ、ツールをお持ちで、より新しい X API v2 エンドポイントへの移行を検討中の場合、本ガイドが役立ちます。

## Recent Post counts の比較

Enterprise 版の Post counts エンドポイントでは、30 日間または full-archive からのカウントを取得できます。したがって、7 日間を対象とする v2 の recent Post counts エンドポイントは、上記のいずれのエンドポイントの直接的な置き換えでもありません。

ただし、比較の便宜上、v2 の recent Post counts エンドポイントを Enterprise の 30-day エンドポイントと比較します。

以下の表は、さまざまなタイプの recent Post counts エンドポイントを比較しています:

| **Description**                                                                                                  | **Enterprise**                                                                | **X API v2**                                                                                       |
| :--------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------- |
| Host domain                                                                                                      | [https://gnip-api.x.com](https://gnip-api.x.com)                              | [https://api.x.com](https://api.x.com)                                                             |
| Endpoint path                                                                                                    | /search/30day/accounts/:account\_name/:label/counts.json                      | /2/tweets/counts/recent                                                                            |
| [認証](/resources/fundamentals/authentication)                                                                     | Basic authentication                                                          | OAuth 2.0 Bearer Token                                                                             |
| Timestamp format                                                                                                 | YYYYMMDDhhmm                                                                  | YYYY-MM-DDTHH:mm:ssZ  <br />[ISO 8601 / RFC 3339](https://tools.ietf.org/html/rfc3339#section-5.6) |
| 返される投稿数の対象期間                                                                                                     | 31 日以内                                                                        | 7 日以内                                                                                              |
| サポートする HTTP メソッド                                                                                                 | GET                                                                           | GET                                                                                                |
| デフォルトのリクエストレート制限                                                                                                 | 1 秒あたり 20 リクエスト。検索データと counts リクエストで合算  <br />1 分あたりのレート制限はパートナーごとに契約で定められます。 | 1 ユーザーあたり 15 分あたり 180 リクエスト  <br />1 App あたり 15 分あたり 450 リクエスト                                     |
| [annotations](/x-api/fundamentals/post-annotations) によるフィルタリングをサポート                                              |                                                                               | ✔                                                                                                  |
| [conversation\_id](/x-api/fundamentals/conversation-id) によるフィルタリングをサポート                                          |                                                                               | ✔                                                                                                  |
| Post データ配列の JSON キー名                                                                                             | results                                                                       | data                                                                                               |
| 時間の粒度                                                                                                            | Day、hour、または minute                                                           | Day、hour、または minute                                                                                |
| タイムゾーン                                                                                                           | UTC                                                                           | UTC                                                                                                |
| 期間を選択するリクエストパラメーター                                                                                               | fromDate  <br />toDate                                                        | start\_time  <br />end\_time                                                                       |
| 投稿 ID でナビゲートするリクエストパラメーター                                                                                        |                                                                               | since\_id  <br />until\_id                                                                         |
| [Project](/resources/fundamentals/developer-apps) に紐づく[開発者 App](/resources/fundamentals/developer-apps) の認証情報が必要 |                                                                               | ✔                                                                                                  |

### Full-archive Post counts の比較

以下の表は、さまざまなタイプの full-archive search エンドポイントを比較しています:

| Description                                                                                                                                                                      | Enterprise                                                | X API v2                                                                                           |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------- | :------------------------------------------------------------------------------------------------- |
| Host domain                                                                                                                                                                      | [https://gnip-api.x.com](https://gnip-api.x.com)          | [https://api.x.com](https://api.x.com)                                                             |
| Endpoint path                                                                                                                                                                    | /search/fullarchive/accounts/:account\_name/:label/counts | /2/tweets/counts/all                                                                               |
| [認証](/resources/fundamentals/authentication)                                                                                                                                     | Basic auth                                                | OAuth 2.0 Bearer Token                                                                             |
| Timestamp format                                                                                                                                                                 | YYYYMMDDHHMM                                              | YYYY-MM-DDTHH:mm:ssZ  <br />[ISO 8601 / RFC 3339](https://tools.ietf.org/html/rfc3339#section-5.6) |
| 返される Post counts の対象期間                                                                                                                                                           | 2006 年 3 月以降の完全アーカイブ                                      | 2006 年 3 月以降の完全アーカイブ                                                                               |
| サポートする HTTP メソッド                                                                                                                                                                 | GET  <br />POST                                           | GET                                                                                                |
| デフォルトのリクエストレート制限                                                                                                                                                                 | 1 分あたりのレート制限はパートナーごとに契約で定められます。  <br />1 秒あたり 20 リクエスト    | 1 App あたり 15 分あたり 300 リクエスト  <br />1 App あたり 1 秒あたり 1 リクエスト                                        |
| Granularity                                                                                                                                                                      | Day、hour、minute                                           | Day、hour、minute                                                                                    |
| [annotations](/x-api/fundamentals/post-annotations) によるフィルタリングをサポート                                                                                                              |                                                           | ✔                                                                                                  |
| [conversation\_id](/x-api/fundamentals/conversation-id) によるフィルタリングをサポート                                                                                                          |                                                           | ✔                                                                                                  |
| Post データ配列の JSON キー名                                                                                                                                                             | results                                                   | data                                                                                               |
| 期間を選択するリクエストパラメーター                                                                                                                                                               | fromDate  <br />toDate                                    | start\_time  <br />end\_time                                                                       |
| 投稿 ID でナビゲートするリクエストパラメーター                                                                                                                                                        |                                                           | since\_id  <br />until\_id                                                                         |
| ページネーション用の JSON キー名                                                                                                                                                              | next                                                      | meta.next\_token                                                                                   |
| ページネーション用のリクエストパラメーター                                                                                                                                                            | next\_token                                               | next\_token または pagination\_token                                                                  |
| タイムゾーン                                                                                                                                                                           | UTC                                                       | UTC                                                                                                |
| [Academic Research アクセス](/x-api/getting-started/about-x-api)を持つ [Project](/resources/fundamentals/developer-apps) に紐づく[開発者 App](/resources/fundamentals/developer-apps) の認証情報が必要 |                                                           | ✔                                                                                                  |

### フィルタリング演算子の比較

Post counts の 2 つのバージョン(Enterprise と v2)では利用可能な演算子が異なり、各バージョン内でも演算子の可用性に差があります。詳細は以下で説明します。

Enterprise

* Enterprise の演算子にサブティアはありません。すべての Enterprise 演算子はすべての Enterprise ユーザーが利用できます。

X API v2

* **Core:** これらの演算子は任意の v2 ユーザーが利用できます。
* **Advanced:** これらの演算子は Academic Research アクセスの承認を受けたユーザーのみ利用できます。

各演算子セットの詳細は、それぞれのガイドをご覧ください:

* [Enterprise operators](/x-api/enterprise-gnip-2.0/fundamentals/search-api#building-search-queries)
* [X API v2 operators](/x-api/posts/search/integrate/build-a-query)

X API v2 内の各演算子レベルを理解した上で、Post counts の演算子可用性を示す表を以下に示します(セルが空白の場合、その演算子は利用できません):

|                   | Enterprise | v2                           |
| :---------------- | :--------- | :--------------------------- |
| keyword           | Available  | Core                         |
| emoji             | Available  | Core                         |
| "exact phrase"    | Available  | Core                         |
| #                 | Available  | Core                         |
| \$                | Available  | Advanced                     |
| @                 | Available  | Core                         |
| from:             | Available  | Core                         |
| to:               | Available  | Core                         |
| url:              | Available  | Core                         |
| retweets\_of:     | Available  | Core                         |
| context:          |            | Core                         |
| entity:           |            | Core - recent search でのみ利用可能 |
| conversation\_id: |            | Core                         |
| place:            | Available  | Advanced                     |
| place\_country:   | Available  | Advanced                     |
| point\_radius:    | Available  | Advanced                     |
| bounding\_box:    | Available  | Advanced                     |
| is:retweet        | Available  | Core                         |
| is:reply          | Available  | Core                         |
| is:quote          | Available  | Core                         |
| is:verified       | Available  | Core                         |
| -is:nullcast      | Available  | Advanced                     |
| has:hashtags      | Available  | Core                         |
| has:cashtags      | Available  | Advanced                     |
| has:links         | Available  | Core                         |
| has:mentions      | Available  | Core                         |
| has:media         | Available  | Core                         |
| has:images        | Available  | Core                         |
| has:videos        | Available  | Core                         |
| has:geo           | Available  | Advanced                     |
| lang:             | Available  | Core                         |
| list:             |            | Advanced                     |
| has:profile\_geo  | Available  |                              |
| profile\_country  | Available  |                              |
| profile\_locality | Available  |                              |
| profile\_region   | Available  |                              |
| proximity         | Available  |                              |

**その他の移行リソース**

[X API 移行ハブ](/x-api/migrate/overview)

[これらのエンドポイントのサンプルコードを確認する](https://github.com/xdevplatform/Twitter-API-v2-sample-code "これらのエンドポイントのサンプルコードを確認する")

[Post counts: Enterprise から X API v2 への移行](/x-api/posts/counts/migrate/overview)
