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

# 投稿を検索

> 強力なクエリ演算子を使用して、キーワード、ハッシュタグ、ユーザーなどで投稿を検索できます

export const Button = ({href, children}) => {
  return <div className="not-prose group">
    <a href={href}>
      <button className="flex items-center space-x-2.5 py-1 px-4 bg-primary-dark dark:bg-white text-white dark:text-gray-950 rounded-full group-hover:opacity-[0.9] font-medium">
        <span>
          {children}
        </span>
        <svg width="3" height="24" viewBox="0 -9 3 24" class="h-6 rotate-0 overflow-visible"><path d="M0 0L3 3L0 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>
      </button>
    </a>
  </div>;
};

Search Posts エンドポイントを使用すると、強力なクエリ演算子を使って特定の条件に一致する投稿を検索できます。キーワード、ハッシュタグ、メンション、URL などを対象に検索できます。

<div id="overview">
  ## 概要
</div>

X では、取得可能な期間とアクセス要件が異なる 2 つの検索エンドポイントを提供しています。

<CardGroup cols={2}>
  <Card title="最近の検索" icon="clock">
    **直近 7 日間**の投稿を検索できます。すべての開発者が利用できます。
  </Card>

  <Card title="全アーカイブ検索" icon="vault">
    2006 年まで遡る **完全なアーカイブ** を検索できます。従量課金プランおよび Enterprise のお客様が利用できます。
  </Card>
</CardGroup>

***

<div id="use-cases">
  ## ユースケース
</div>

* **ブランドモニタリング** — 自社ブランドや製品に関する言及をモニタリングする
* **トレンド分析** — 特定のトピックやイベントに関する会話を分析する
* **リサーチ** — 学術研究や市場調査向けのデータを収集する
* **リアルタイムリスニング** — 新しい投稿に反応するアプリケーションを構築する

***

<div id="endpoints">
  ## エンドポイント
</div>

| Method | Endpoint                                                         | Description    | Access           |
| :----- | :--------------------------------------------------------------- | :------------- | :--------------- |
| GET    | [`/2/tweets/search/recent`](/ja/x-api/posts/search-recent-posts) | 過去7日間の投稿を検索    | すべての開発者          |
| GET    | [`/2/tweets/search/all`](/ja/x-api/posts/search-all-posts)       | 全期間の投稿アーカイブを検索 | 従量課金制、Enterprise |

***

<div id="query-operators">
  ## クエリ演算子
</div>

ポストの属性にマッチする演算子を使用してクエリを構築します。

```
(AI OR "artificial intelligence") lang:en -is:retweet has:links
```

<AccordionGroup>
  <Accordion title="キーワード演算子">
    | Operator | Example              | Description        |
    | :------- | :------------------- | :----------------- |
    | Keyword  | `python`             | 指定した単語を含む投稿        |
    | Phrase   | `"machine learning"` | 完全一致するフレーズを含む投稿    |
    | Hashtag  | `#AI`                | 指定したハッシュタグを含む投稿    |
    | Mention  | `@XDevelopers`       | 特定ユーザーへのメンションを含む投稿 |
  </Accordion>

  <Accordion title="ユーザー演算子">
    | Operator       | Example          | Description     |
    | :------------- | :--------------- | :-------------- |
    | `from:`        | `from:elonmusk`  | 特定ユーザーによる投稿     |
    | `to:`          | `to:XDevelopers` | 特定ユーザーへの返信      |
    | `retweets_of:` | `retweets_of:X`  | 特定ユーザーの投稿のリツイート |
  </Accordion>

  <Accordion title="コンテンツ演算子">
    | Operator       | Example          | Description   |
    | :------------- | :--------------- | :------------ |
    | `has:images`   | `cat has:images` | 画像を含む投稿       |
    | `has:videos`   | `has:videos`     | 動画を含む投稿       |
    | `has:links`    | `has:links`      | リンクを含む投稿      |
    | `has:mentions` | `has:mentions`   | メンションを含む投稿    |
    | `url:`         | `url:github.com` | 特定の URL を含む投稿 |
  </Accordion>

  <Accordion title="フィルター演算子">
    | Operator      | Example       | Description   |
    | :------------ | :------------ | :------------ |
    | `lang:`       | `lang:en`     | 特定の言語の投稿      |
    | `-is:retweet` | `-is:retweet` | リツイートを除外した投稿  |
    | `-is:reply`   | `-is:reply`   | 返信を除外した投稿     |
    | `is:verified` | `is:verified` | 認証済みユーザーによる投稿 |
  </Accordion>
</AccordionGroup>

<Card title="演算子の完全なリファレンス" icon="list-check" href="/ja/x-api/posts/search/integrate/operators">
  利用可能なすべての演算子とそのアクセス要件を確認できます
</Card>

***

<div id="recent-search">
  ## 最近の検索
</div>

**過去7日間**の投稿を検索できます。すべての開発者が利用可能です。

<div id="features">
  ### 機能
</div>

* 1リクエストあたり最大100件の投稿
* 大規模な結果セットに対するページネーション
* すべての主要なクエリ演算子
* クエリ長は512文字 (Enterpriseでは4,096文字)

<CardGroup cols={2}>
  <Card title="クイックスタート" icon="rocket" href="/ja/x-api/posts/search/quickstart/recent-search">
    最初の最近検索リクエストを実行する
  </Card>

  <Card title="APIリファレンス" icon="code" href="/ja/x-api/posts/search-recent-posts">
    エンドポイントの詳細なドキュメント
  </Card>
</CardGroup>

***

<div id="full-archive-search">
  ## フルアーカイブ検索
</div>

2006年3月までさかのぼる**ポストの全アーカイブ**を検索できます。

<Note>
  フルアーカイブ検索は、従量課金制プランおよび Enterprise のお客様にご利用いただけます。
</Note>

<div id="features">
  ### 機能
</div>

* 1件のリクエストにつき最大500件の投稿
* 投稿の全履歴にアクセス可能
* すべてのクエリ演算子を利用可能
* クエリ長は最大1,024文字 (Enterpriseでは4,096文字)

<CardGroup cols={2}>
  <Card title="クイックスタート" icon="rocket" href="/ja/x-api/posts/search/quickstart/full-archive-search">
    最初の全アーカイブ検索リクエストを実行する
  </Card>

  <Card title="APIリファレンス" icon="code" href="/ja/x-api/posts/search-all-posts">
    エンドポイントの全ドキュメント
  </Card>
</CardGroup>

***

<div id="getting-started">
  ## はじめに
</div>

<Note>
  **前提条件**

  * 承認済みの[開発者アカウント](https://developer.x.com/en/portal/petition/essential/basic-info)
  * 開発者コンソールの [Project と App](/ja/resources/fundamentals/developer-apps)
  * App の[キーとトークン](/ja/resources/fundamentals/authentication)
</Note>

<CardGroup cols={2}>
  <Card title="クエリの作成" icon="magnifying-glass" href="/ja/x-api/posts/search/integrate/build-a-query">
    クエリ構文と演算子について学ぶ
  </Card>

  <Card title="ページネーション" icon="arrow-right" href="/ja/x-api/posts/search/integrate/paginate">
    大規模な結果セットをページングしながら取得する
  </Card>

  <Card title="統合ガイド" icon="book" href="/ja/x-api/posts/search/integrate/overview">
    主要な概念とベストプラクティス
  </Card>

  <Card title="サンプルコード" icon="github" href="https://github.com/xdevplatform/Twitter-API-v2-sample-code">
    実行可能なコード例
  </Card>
</CardGroup>
