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

# サンプリングされた投稿をストリーミングする

> 公開ポスト全体のうち1%をサンプルとしてリアルタイムにストリーミングします。



## OpenAPI

````yaml /ja/openapi.json GET /2/tweets/sample/stream
openapi: 3.0.0
info:
  description: X API v2 で利用可能なエンドポイント
  version: '2.157'
  title: X API v2
  termsOfService: https://developer.x.com/en/developer-terms/agreement-and-policy.html
  contact:
    name: X Developers
    url: https://developer.x.com/
  license:
    name: X Developer Agreement and Policy
    url: https://developer.x.com/en/developer-terms/agreement-and-policy.html
servers:
  - description: X API
    url: https://api.x.com
security: []
tags:
  - name: Account Activity
    description: AAA サブスクリプションの取得および管理用のエンドポイント
    externalDocs:
      description: 詳細はこちら
      url: >-
        https://docs.x.com/x-api/enterprise-gnip-2.0/fundamentals/account-activity
  - name: Bookmarks
    description: ユーザーのブックマークを取得および管理するためのエンドポイント
    externalDocs:
      description: 詳細を見る
      url: https://developer.twitter.com/en/docs/twitter-api/bookmarks
  - name: Compliance
    description: 自社システム内の X データのコンプライアンスを維持するためのエンドポイント
    externalDocs:
      description: 詳細を見る
      url: >-
        https://developer.twitter.com/en/docs/twitter-api/compliance/batch-tweet/introduction
  - name: Connections
    description: ストリーミング接続を扱うエンドポイント
    externalDocs:
      description: 詳細を見る
      url: https://developer.x.com/en/docs/x-api/connections
  - name: Direct Messages
    description: ダイレクトメッセージを取得および管理するためのエンドポイント
    externalDocs:
      description: 詳細を見る
      url: https://developer.twitter.com/en/docs/twitter-api/direct-messages
  - name: General
    description: その他の一般的な API 機能向けエンドポイント
    externalDocs:
      description: 詳細を見る
      url: https://developer.twitter.com/en/docs/twitter-api
  - name: Lists
    description: リストの取得と管理用エンドポイント
    externalDocs:
      description: 詳細を見る
      url: https://developer.twitter.com/en/docs/twitter-api/lists
  - name: Media
    description: メディア用エンドポイント
    externalDocs:
      description: 詳細を見る
      url: https://developer.x.com
  - name: MediaUpload
    description: メディアアップロード用エンドポイント
    externalDocs:
      description: 詳細を見る
      url: https://developer.x.com
  - name: News
    description: ニュース記事取得用エンドポイント
    externalDocs:
      description: 詳細を見る
      url: https://developer.twitter.com/en/docs/twitter-api/news
  - name: Spaces
    description: Spaces の取得と管理用エンドポイント
    externalDocs:
      description: 詳細を見る
      url: https://developer.twitter.com/en/docs/twitter-api/spaces
  - name: Stream
    description: ストリーミングに関連するエンドポイント
    externalDocs:
      description: 詳細を見る
      url: https://developer.x.com
  - name: Tweets
    description: ツイートの取得・検索・変更に関連するエンドポイント
    externalDocs:
      description: 詳細を見る
      url: https://developer.twitter.com/en/docs/twitter-api/tweets/lookup
  - name: Users
    description: ユーザーおよびユーザー間の関係を取得・管理するためのエンドポイント
    externalDocs:
      description: 詳細を見る
      url: https://developer.twitter.com/en/docs/twitter-api/users/lookup
paths:
  /2/tweets/sample/stream:
    get:
      tags:
        - Stream
        - Tweets
      summary: サンプリングされた投稿をストリーミングする
      description: 公開ポスト全体のうち1%をサンプルとしてリアルタイムにストリーミングします。
      operationId: streamPostsSample
      parameters:
        - name: backfill_minutes
          in: query
          description: 要求されたバックフィル時間（分単位）。
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 5
            format: int32
          style: form
        - $ref: '#/components/parameters/TweetFieldsParameter'
        - $ref: '#/components/parameters/TweetExpansionsParameter'
        - $ref: '#/components/parameters/MediaFieldsParameter'
        - $ref: '#/components/parameters/PollFieldsParameter'
        - $ref: '#/components/parameters/UserFieldsParameter'
        - $ref: '#/components/parameters/PlaceFieldsParameter'
      responses:
        '200':
          description: リクエストは成功しました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StreamingTweetResponse'
        default:
          description: リクエストは失敗しました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      security:
        - BearerToken: []
      externalDocs:
        url: >-
          https://developer.twitter.com/en/docs/twitter-api/tweets/volume-streams/api-reference/get-tweets-sample-stream
components:
  parameters:
    TweetFieldsParameter:
      name: tweet.fields
      in: query
      description: 表示するツイートのフィールドを、カンマ区切りで指定するリスト。
      required: false
      schema:
        type: array
        description: ツイートオブジェクトで使用できるフィールド。
        minItems: 1
        uniqueItems: true
        items:
          type: string
          enum:
            - article
            - attachments
            - author_id
            - card_uri
            - community_id
            - context_annotations
            - conversation_id
            - created_at
            - display_text_range
            - edit_controls
            - edit_history_tweet_ids
            - entities
            - geo
            - id
            - in_reply_to_user_id
            - lang
            - media_metadata
            - non_public_metrics
            - note_tweet
            - organic_metrics
            - possibly_sensitive
            - promoted_metrics
            - public_metrics
            - referenced_tweets
            - reply_settings
            - scopes
            - source
            - suggested_source_links
            - suggested_source_links_with_counts
            - text
            - withheld
        example:
          - article
          - attachments
          - author_id
          - card_uri
          - community_id
          - context_annotations
          - conversation_id
          - created_at
          - display_text_range
          - edit_controls
          - edit_history_tweet_ids
          - entities
          - geo
          - id
          - in_reply_to_user_id
          - lang
          - media_metadata
          - non_public_metrics
          - note_tweet
          - organic_metrics
          - possibly_sensitive
          - promoted_metrics
          - public_metrics
          - referenced_tweets
          - reply_settings
          - scopes
          - source
          - suggested_source_links
          - suggested_source_links_with_counts
          - text
          - withheld
      explode: false
      style: form
    TweetExpansionsParameter:
      name: expansions
      in: query
      description: 展開するフィールドを指定するカンマ区切りのリストです。
      schema:
        type: array
        description: '[ツイート](#Tweet) オブジェクトで展開可能なフィールドの一覧です。ID フィールドがある場合は、完全なオブジェクトに展開できます。'
        minItems: 1
        uniqueItems: true
        items:
          type: string
          enum:
            - article.cover_media
            - article.media_entities
            - attachments.media_keys
            - attachments.media_source_tweet
            - attachments.poll_ids
            - author_id
            - edit_history_tweet_ids
            - entities.mentions.username
            - geo.place_id
            - in_reply_to_user_id
            - entities.note.mentions.username
            - referenced_tweets.id
            - referenced_tweets.id.attachments.media_keys
            - referenced_tweets.id.author_id
        example:
          - article.cover_media
          - article.media_entities
          - attachments.media_keys
          - attachments.media_source_tweet
          - attachments.poll_ids
          - author_id
          - edit_history_tweet_ids
          - entities.mentions.username
          - geo.place_id
          - in_reply_to_user_id
          - entities.note.mentions.username
          - referenced_tweets.id
          - referenced_tweets.id.attachments.media_keys
          - referenced_tweets.id.author_id
      explode: false
      style: form
    MediaFieldsParameter:
      name: media.fields
      in: query
      description: 取得する Media フィールドをカンマ区切りで指定します。
      required: false
      schema:
        type: array
        description: Media オブジェクトで使用できるフィールドです。
        minItems: 1
        uniqueItems: true
        items:
          type: string
          enum:
            - alt_text
            - duration_ms
            - height
            - media_key
            - non_public_metrics
            - organic_metrics
            - preview_image_url
            - promoted_metrics
            - public_metrics
            - type
            - url
            - variants
            - width
        example:
          - alt_text
          - duration_ms
          - height
          - media_key
          - non_public_metrics
          - organic_metrics
          - preview_image_url
          - promoted_metrics
          - public_metrics
          - type
          - url
          - variants
          - width
      explode: false
      style: form
    PollFieldsParameter:
      name: poll.fields
      in: query
      description: レスポンスに含める Poll フィールドのカンマ区切りのリスト。
      required: false
      schema:
        type: array
        description: Poll オブジェクトで利用可能なフィールド。
        minItems: 1
        uniqueItems: true
        items:
          type: string
          enum:
            - duration_minutes
            - end_datetime
            - id
            - options
            - voting_status
        example:
          - duration_minutes
          - end_datetime
          - id
          - options
          - voting_status
      explode: false
      style: form
    UserFieldsParameter:
      name: user.fields
      in: query
      description: 表示する User フィールドを指定するカンマ区切りのリストです。
      required: false
      schema:
        type: array
        description: User オブジェクトで利用可能なフィールドです。
        minItems: 1
        uniqueItems: true
        items:
          type: string
          enum:
            - affiliation
            - confirmed_email
            - connection_status
            - created_at
            - description
            - entities
            - id
            - is_identity_verified
            - location
            - most_recent_tweet_id
            - name
            - parody
            - pinned_tweet_id
            - profile_banner_url
            - profile_image_url
            - protected
            - public_metrics
            - receives_your_dm
            - subscription
            - subscription_type
            - url
            - username
            - verified
            - verified_followers_count
            - verified_type
            - withheld
        example:
          - affiliation
          - confirmed_email
          - connection_status
          - created_at
          - description
          - entities
          - id
          - is_identity_verified
          - location
          - most_recent_tweet_id
          - name
          - parody
          - pinned_tweet_id
          - profile_banner_url
          - profile_image_url
          - protected
          - public_metrics
          - receives_your_dm
          - subscription
          - subscription_type
          - url
          - username
          - verified
          - verified_followers_count
          - verified_type
          - withheld
      explode: false
      style: form
    PlaceFieldsParameter:
      name: place.fields
      in: query
      description: 取得する Place フィールドをカンマ区切りで指定します。
      required: false
      schema:
        type: array
        description: Place オブジェクトで利用可能なフィールド。
        minItems: 1
        uniqueItems: true
        items:
          type: string
          enum:
            - contained_within
            - country
            - country_code
            - full_name
            - geo
            - id
            - name
            - place_type
        example:
          - contained_within
          - country
          - country_code
          - full_name
          - geo
          - id
          - name
          - place_type
      explode: false
      style: form
  schemas:
    StreamingTweetResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/Tweet'
        errors:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Problem'
        includes:
          $ref: '#/components/schemas/Expansions'
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
    Problem:
      type: object
      description: >-
        IETF RFC 7807 (https://tools.ietf.org/html/rfc7807) で定義された HTTP Problem
        Details オブジェクト。
      required:
        - type
        - title
      properties:
        detail:
          type: string
        status:
          type: integer
        title:
          type: string
        type:
          type: string
      discriminator:
        propertyName: type
        mapping:
          about:blank:
            $ref: '#/components/schemas/GenericProblem'
          https://api.twitter.com/2/problems/client-disconnected:
            $ref: '#/components/schemas/ClientDisconnectedProblem'
          https://api.twitter.com/2/problems/client-forbidden:
            $ref: '#/components/schemas/ClientForbiddenProblem'
          https://api.twitter.com/2/problems/conflict:
            $ref: '#/components/schemas/ConflictProblem'
          https://api.twitter.com/2/problems/disallowed-resource:
            $ref: '#/components/schemas/DisallowedResourceProblem'
          https://api.twitter.com/2/problems/duplicate-rules:
            $ref: '#/components/schemas/DuplicateRuleProblem'
          https://api.twitter.com/2/problems/invalid-request:
            $ref: '#/components/schemas/InvalidRequestProblem'
          https://api.twitter.com/2/problems/invalid-rules:
            $ref: '#/components/schemas/InvalidRuleProblem'
          https://api.twitter.com/2/problems/noncompliant-rules:
            $ref: '#/components/schemas/NonCompliantRulesProblem'
          https://api.twitter.com/2/problems/not-authorized-for-field:
            $ref: '#/components/schemas/FieldUnauthorizedProblem'
          https://api.twitter.com/2/problems/not-authorized-for-resource:
            $ref: '#/components/schemas/ResourceUnauthorizedProblem'
          https://api.twitter.com/2/problems/operational-disconnect:
            $ref: '#/components/schemas/OperationalDisconnectProblem'
          https://api.twitter.com/2/problems/resource-not-found:
            $ref: '#/components/schemas/ResourceNotFoundProblem'
          https://api.twitter.com/2/problems/resource-unavailable:
            $ref: '#/components/schemas/ResourceUnavailableProblem'
          https://api.twitter.com/2/problems/rule-cap:
            $ref: '#/components/schemas/RulesCapProblem'
          https://api.twitter.com/2/problems/streaming-connection:
            $ref: '#/components/schemas/ConnectionExceptionProblem'
          https://api.twitter.com/2/problems/unsupported-authentication:
            $ref: '#/components/schemas/UnsupportedAuthenticationProblem'
          https://api.twitter.com/2/problems/usage-capped:
            $ref: '#/components/schemas/UsageCapExceededProblem'
    Tweet:
      type: object
      properties:
        attachments:
          type: object
          description: このポストに添付されているメディア（存在する場合）の種類を指定します。
          properties:
            media_keys:
              type: array
              description: （メディアが添付されている場合）各メディア添付に対応する Media Key のリスト。
              minItems: 1
              items:
                $ref: '#/components/schemas/MediaKey'
            media_source_tweet_id:
              type: array
              description: >-
                このポスト上のメディアが元々投稿されたポストのリスト。たとえば、あるポストのメディアが別のポストで再利用されている場合、ここには元のポスト（ソースポスト）が含まれます。
              minItems: 1
              items:
                $ref: '#/components/schemas/TweetId'
            poll_ids:
              type: array
              description: （投票が添付されている場合）投票のIDのリスト。
              minItems: 1
              items:
                $ref: '#/components/schemas/PollId'
        author_id:
          $ref: '#/components/schemas/UserId'
        community_id:
          $ref: '#/components/schemas/CommunityId'
        context_annotations:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/ContextAnnotation'
        conversation_id:
          $ref: '#/components/schemas/TweetId'
        created_at:
          type: string
          description: ツイートが作成された日時。
          format: date-time
          example: '2021-01-06T18:40:40.000Z'
        display_text_range:
          $ref: '#/components/schemas/DisplayTextRange'
        edit_controls:
          type: object
          required:
            - is_edit_eligible
            - editable_until
            - edits_remaining
          properties:
            editable_until:
              type: string
              description: ツイートが編集できなくなる日時。
              format: date-time
              example: '2021-01-06T18:40:40.000Z'
            edits_remaining:
              type: integer
              description: ツイートを編集できる回数。
            is_edit_eligible:
              type: boolean
              description: ツイートが編集可能かどうかを示します。
              example: false
        edit_history_tweet_ids:
          type: array
          description: このツイートチェーン内に含まれるツイートIDの一覧。
          minItems: 1
          items:
            $ref: '#/components/schemas/TweetId'
        entities:
          $ref: '#/components/schemas/FullTextEntities'
        geo:
          type: object
          description: ユーザーが指定した場合に、ツイートにタグ付けされた位置情報。
          properties:
            coordinates:
              $ref: '#/components/schemas/Point'
            place_id:
              $ref: '#/components/schemas/PlaceId'
        id:
          $ref: '#/components/schemas/TweetId'
        in_reply_to_user_id:
          $ref: '#/components/schemas/UserId'
        lang:
          type: string
          description: X によって検出された場合のツイートの言語。BCP47 言語タグとして返されます。
          example: en
        non_public_metrics:
          type: object
          description: リクエスト時点におけるこのツイートの非公開エンゲージメント指標。
          properties:
            impression_count:
              type: integer
              description: このツイートが閲覧された回数。
              format: int32
        note_tweet:
          type: object
          description: ツイート本文全体。280文字を超えるテキストも含まれます。
          properties:
            entities:
              type: object
              properties:
                cashtags:
                  type: array
                  minItems: 1
                  items:
                    $ref: '#/components/schemas/CashtagEntity'
                hashtags:
                  type: array
                  minItems: 1
                  items:
                    $ref: '#/components/schemas/HashtagEntity'
                mentions:
                  type: array
                  minItems: 1
                  items:
                    $ref: '#/components/schemas/MentionEntity'
                urls:
                  type: array
                  minItems: 1
                  items:
                    $ref: '#/components/schemas/UrlEntity'
            text:
              $ref: '#/components/schemas/NoteTweetText'
        organic_metrics:
          type: object
          description: リクエスト時点におけるこのツイートのオーガニックな非公開エンゲージメント指標。
          required:
            - impression_count
            - retweet_count
            - reply_count
            - like_count
          properties:
            impression_count:
              type: integer
              description: このツイートが閲覧された回数。
            like_count:
              type: integer
              description: このツイートが「いいね」された回数。
            reply_count:
              type: integer
              description: このツイートに返信された回数。
            retweet_count:
              type: integer
              description: このツイートがリツイートされた回数。
        possibly_sensitive:
          type: boolean
          description: このツイートに、成人向けコンテンツなど、センシティブとしてマークされたURLが含まれているかどうかを示します。
          example: false
        promoted_metrics:
          type: object
          description: リクエスト時点の、このツイートのプロモーション用非公開エンゲージメント指標。
          properties:
            impression_count:
              type: integer
              description: このツイートが表示された回数。
              format: int32
            like_count:
              type: integer
              description: このツイートが「いいね」された回数。
              format: int32
            reply_count:
              type: integer
              description: このツイートに返信された回数。
              format: int32
            retweet_count:
              type: integer
              description: このツイートがリツイートされた回数。
              format: int32
        public_metrics:
          type: object
          description: リクエスト時点の、このツイートのエンゲージメント指標。
          required:
            - retweet_count
            - reply_count
            - like_count
            - impression_count
            - bookmark_count
          properties:
            bookmark_count:
              type: integer
              description: このツイートがブックマークされた回数。
              format: int32
            impression_count:
              type: integer
              description: このツイートが表示された回数。
              format: int32
            like_count:
              type: integer
              description: このツイートが「いいね」された回数。
            quote_count:
              type: integer
              description: このツイートが引用された回数。
            reply_count:
              type: integer
              description: このツイートに返信された回数。
            retweet_count:
              type: integer
              description: このツイートがリツイートされた回数。
        referenced_tweets:
          type: array
          description: >-
            このツイートが参照しているツイートのリストです。たとえば、このツイートがリツイート、引用ツイート、または返信である場合、そのツイートが参照している関連ツイートが含まれます。
          minItems: 1
          items:
            type: object
            required:
              - type
              - id
            properties:
              id:
                $ref: '#/components/schemas/TweetId'
              type:
                type: string
                enum:
                  - retweeted
                  - quoted
                  - replied_to
        reply_settings:
          $ref: '#/components/schemas/ReplySettingsWithVerifiedUsers'
        scopes:
          type: object
          description: このツイートの公開範囲。
          properties:
            followers:
              type: boolean
              description: このツイートが、ツイートIDがなくてもフォロワーに表示されるかどうかを示します。
              example: false
        source:
          type: string
          description: このフィールドは非推奨です。
        suggested_source_links:
          type: array
          minItems: 0
          items:
            $ref: '#/components/schemas/UrlEntity'
        suggested_source_links_with_counts:
          type: object
          description: 提案されたソースリンクと、その各リンクを含むリクエスト数。
          properties:
            count:
              type: integer
              description: そのソースリンクを含むノートリクエストの数。
            url:
              $ref: '#/components/schemas/UrlEntity'
        text:
          $ref: '#/components/schemas/TweetText'
        username:
          $ref: '#/components/schemas/UserName'
        withheld:
          $ref: '#/components/schemas/TweetWithheld'
      example:
        author_id: '2244994945'
        created_at: Wed Jan 06 18:40:40 +0000 2021
        id: '1346889436626259968'
        text: >-
          Learn how to use the user Tweet timeline and user mention timeline
          endpoints in the X API v2 to explore Tweet\u2026
          https:\/\/t.co\/56a0vZUx7i
        username: XDevelopers
    Expansions:
      type: object
      properties:
        media:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Media'
        places:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Place'
        polls:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Poll'
        topics:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Topic'
        tweets:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/Tweet'
        users:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/User'
    GenericProblem:
      description: HTTP ステータスコードで提供される情報以外の追加情報を持たない汎用的な Problem です。
      allOf:
        - $ref: '#/components/schemas/Problem'
    ClientDisconnectedProblem:
      description: クライアントとの接続が切断されました。
      allOf:
        - $ref: '#/components/schemas/Problem'
    ClientForbiddenProblem:
      description: このクライアントがこのリクエストを実行することを禁止されていることを示すProblemです。
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          properties:
            reason:
              type: string
              enum:
                - official-client-forbidden
                - client-not-enrolled
            registration_url:
              type: string
              format: uri
    ConflictProblem:
      description: すでに進行中のジョブがある場合は、新しいジョブを作成できません。
      allOf:
        - $ref: '#/components/schemas/Problem'
    DisallowedResourceProblem:
      description: 要求されたリソースがこの API の原則に違反していることを示す Problem。
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          required:
            - resource_id
            - resource_type
            - section
          properties:
            resource_id:
              type: string
            resource_type:
              type: string
              enum:
                - user
                - tweet
                - media
                - list
                - space
            section:
              type: string
              enum:
                - data
                - includes
    DuplicateRuleProblem:
      description: 送信したルールが重複しています。
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          properties:
            id:
              type: string
            value:
              type: string
    InvalidRequestProblem:
      description: このリクエストが無効であることを示す Problem。
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          properties:
            errors:
              type: array
              minItems: 1
              items:
                type: object
                properties:
                  message:
                    type: string
                  parameters:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        type: string
    InvalidRuleProblem:
      description: 送信されたルールは無効です。
      allOf:
        - $ref: '#/components/schemas/Problem'
    NonCompliantRulesProblem:
      description: ユーザーのルールセットが仕様に準拠していないことを示す Problem。
      allOf:
        - $ref: '#/components/schemas/Problem'
    FieldUnauthorizedProblem:
      description: 特定のツイートやユーザーなどのフィールドを閲覧する権限がないことを示す Problem です。
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          required:
            - resource_type
            - field
            - section
          properties:
            field:
              type: string
            resource_type:
              type: string
              enum:
                - user
                - tweet
                - media
                - list
                - space
            section:
              type: string
              enum:
                - data
                - includes
    ResourceUnauthorizedProblem:
      description: 特定のツイートやユーザーなどを閲覧する権限がないことを示す問題です。
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          required:
            - value
            - resource_id
            - resource_type
            - section
            - parameter
          properties:
            parameter:
              type: string
            resource_id:
              type: string
            resource_type:
              type: string
              enum:
                - user
                - tweet
                - media
                - list
                - space
            section:
              type: string
              enum:
                - data
                - includes
            value:
              type: string
    OperationalDisconnectProblem:
      description: 運用上の理由により接続が切断されました。
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          properties:
            disconnect_type:
              type: string
              enum:
                - OperationalDisconnect
                - UpstreamOperationalDisconnect
                - ForceDisconnect
                - UpstreamUncleanDisconnect
                - SlowReader
                - InternalError
                - ClientApplicationStateDegraded
                - InvalidRules
    ResourceNotFoundProblem:
      description: 指定されたツイートやユーザーなどが存在しないことを示す Problem です。
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          required:
            - parameter
            - value
            - resource_id
            - resource_type
          properties:
            parameter:
              type: string
              minLength: 1
            resource_id:
              type: string
            resource_type:
              type: string
              enum:
                - user
                - tweet
                - media
                - list
                - space
            value:
              type: string
              description: 値はそのフィールドのスキーマに準拠します。
    ResourceUnavailableProblem:
      description: 特定のツイートやユーザーなどがあなたからは利用できない状態であることを示す問題です。
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          required:
            - parameter
            - resource_id
            - resource_type
          properties:
            parameter:
              type: string
              minLength: 1
            resource_id:
              type: string
            resource_type:
              type: string
              enum:
                - user
                - tweet
                - media
                - list
                - space
    RulesCapProblem:
      description: ルール数の上限を超えました。
      allOf:
        - $ref: '#/components/schemas/Problem'
    ConnectionExceptionProblem:
      description: 接続に問題が発生していることを示す Problem。
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          properties:
            connection_issue:
              type: string
              enum:
                - TooManyConnections
                - ProvisioningSubscription
                - RuleConfigurationIssue
                - RulesInvalidIssue
    UnsupportedAuthenticationProblem:
      description: 使用されている認証方式がサポートされていないことを示す Problem オブジェクト。
      allOf:
        - $ref: '#/components/schemas/Problem'
    UsageCapExceededProblem:
      description: 使用量の上限を超過したことを示す Problem オブジェクト。
      allOf:
        - $ref: '#/components/schemas/Problem'
        - type: object
          properties:
            period:
              type: string
              enum:
                - Daily
                - Monthly
            scope:
              type: string
              enum:
                - Account
                - Product
    MediaKey:
      type: string
      description: このアタッチメントに対する media_key 識別子です。
      pattern: ^([0-9]+)_([0-9]+)$
    TweetId:
      type: string
      description: このツイートの一意の識別子。大きな整数を扱えない言語やツールでの問題を避けるため、文字列として返されます。
      pattern: ^[0-9]{1,19}$
      example: '1346889436626259968'
    PollId:
      type: string
      description: この poll の一意の識別子です。
      pattern: ^[0-9]{1,19}$
      example: '1365059861688410112'
    UserId:
      type: string
      description: このユーザーの一意の識別子。大きな整数値を扱えない言語やツールとの互換性の問題を避けるため、文字列として返されます。
      pattern: ^[0-9]{1,19}$
      example: '2244994945'
    CommunityId:
      type: string
      description: このコミュニティの一意の識別子。
      pattern: ^[0-9]{1,19}$
      example: '1146654567674912769'
    ContextAnnotation:
      type: object
      description: ツイート本文から推論されたアノテーション。
      required:
        - domain
        - entity
      properties:
        domain:
          $ref: '#/components/schemas/ContextAnnotationDomainFields'
        entity:
          $ref: '#/components/schemas/ContextAnnotationEntityFields'
    DisplayTextRange:
      type: array
      description: >-
        ポストとして表示されるテキスト部分の境界（開始および終了のゼロ基準インデックス）を表します。`start` は `end`
        より小さい必要があります。開始インデックスは包含（含む）、終了インデックスは排他（含まない）です。
      minItems: 2
      maxItems: 2
      items:
        type: integer
        minimum: 0
    FullTextEntities:
      type: object
      properties:
        annotations:
          type: array
          minItems: 1
          items:
            description: ツイート本文に基づいて抽出されたエンティティのアノテーション。
            allOf:
              - $ref: '#/components/schemas/EntityIndicesInclusiveInclusive'
              - type: object
                description: アノテーションデータを表します。
                properties:
                  normalized_text:
                    type: string
                    description: このアノテーションを決定するために使用されたテキスト。
                    example: Barack Obama
                  probability:
                    type: number
                    description: このアノテーション種別に対する信頼度スコア。
                    minimum: 0
                    maximum: 1
                    format: double
                  type:
                    type: string
                    description: アノテーションの種別。
                    example: Person
        cashtags:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/CashtagEntity'
        hashtags:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/HashtagEntity'
        mentions:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/MentionEntity'
        urls:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/UrlEntity'
    Point:
      type: object
      description: >-
        [GeoJSON Point](https://tools.ietf.org/html/rfc7946#section-3.1.2)
        ジオメトリオブジェクトです。
      required:
        - type
        - coordinates
      properties:
        coordinates:
          $ref: '#/components/schemas/Position'
        type:
          type: string
          enum:
            - Point
          example: Point
    PlaceId:
      type: string
      description: この場所の識別子。
      example: f7eb2fa2fea288b1
    CashtagEntity:
      allOf:
        - $ref: '#/components/schemas/EntityIndicesInclusiveExclusive'
        - $ref: '#/components/schemas/CashtagFields'
    HashtagEntity:
      allOf:
        - $ref: '#/components/schemas/EntityIndicesInclusiveExclusive'
        - $ref: '#/components/schemas/HashtagFields'
    MentionEntity:
      allOf:
        - $ref: '#/components/schemas/EntityIndicesInclusiveExclusive'
        - $ref: '#/components/schemas/MentionFields'
    UrlEntity:
      description: URL として認識されたテキスト部分と、そのテキスト内での開始位置および終了位置を表します。
      allOf:
        - $ref: '#/components/schemas/EntityIndicesInclusiveExclusive'
        - $ref: '#/components/schemas/UrlFields'
    NoteTweetText:
      type: string
      description: ツイートに対するノート本文。
      example: >-
        Learn how to use the user Tweet timeline and user mention timeline
        endpoints in the X API v2 to explore Tweet\u2026
        https:\/\/t.co\/56a0vZUx7i
    ReplySettingsWithVerifiedUsers:
      type: string
      description: >-
        そのツイートに返信することを許可されるユーザーを示します。返される可能性があるフィールド値は、everyone、mentioned_users、subscribers、verified、following
        です。
      pattern: ^[A-Za-z]{1,12}$
      enum:
        - everyone
        - mentionedUsers
        - following
        - other
        - subscribers
        - verified
    TweetText:
      type: string
      description: ツイートの内容。
      example: >-
        Learn how to use the user Tweet timeline and user mention timeline
        endpoints in the X API v2 to explore Tweet\u2026
        https:\/\/t.co\/56a0vZUx7i
    UserName:
      type: string
      description: このユーザーの X 上のハンドル（スクリーンネーム）。
      pattern: ^[A-Za-z0-9_]{1,15}$
    TweetWithheld:
      type: object
      description: >-
        [保留されたコンテンツ](https://help.twitter.com/en/rules-and-policies/tweet-withheld-by-country)に関する詳細情報を示します。
      required:
        - copyright
        - country_codes
      properties:
        copyright:
          type: boolean
          description: 著作権侵害を理由としてコンテンツが保留されているかどうかを示します。
        country_codes:
          type: array
          description: このコンテンツを利用できない国のリストを返します。
          minItems: 1
          uniqueItems: true
          items:
            $ref: '#/components/schemas/CountryCode'
        scope:
          type: string
          description: 差し止められているコンテンツが `tweet` なのか `user` なのかを示します。
          enum:
            - tweet
            - user
    Media:
      type: object
      required:
        - type
      properties:
        height:
          $ref: '#/components/schemas/MediaHeight'
        media_key:
          $ref: '#/components/schemas/MediaKey'
        type:
          type: string
        width:
          $ref: '#/components/schemas/MediaWidth'
      discriminator:
        propertyName: type
        mapping:
          animated_gif:
            $ref: '#/components/schemas/AnimatedGif'
          photo:
            $ref: '#/components/schemas/Photo'
          video:
            $ref: '#/components/schemas/Video'
    Place:
      type: object
      required:
        - id
        - full_name
      properties:
        contained_within:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/PlaceId'
        country:
          type: string
          description: この場所が属している郡の正式名称。
          example: United States
        country_code:
          $ref: '#/components/schemas/CountryCode'
        full_name:
          type: string
          description: この場所の正式名称。
          example: Lakewood, CO
        geo:
          $ref: '#/components/schemas/Geo'
        id:
          $ref: '#/components/schemas/PlaceId'
        name:
          type: string
          description: この場所の人間が読める形式の名前。
          example: Lakewood
        place_type:
          $ref: '#/components/schemas/PlaceType'
    Poll:
      type: object
      description: ツイートに紐づく Poll を表します。
      required:
        - id
        - options
      properties:
        duration_minutes:
          type: integer
          minimum: 5
          maximum: 10080
          format: int32
        end_datetime:
          type: string
          format: date-time
        id:
          $ref: '#/components/schemas/PollId'
        options:
          type: array
          minItems: 2
          maxItems: 4
          items:
            $ref: '#/components/schemas/PollOption'
        voting_status:
          type: string
          enum:
            - open
            - closed
    Topic:
      type: object
      description: 作成者が選択した Space のトピック。
      required:
        - id
        - name
      properties:
        description:
          type: string
          description: 指定されたトピックの説明。
          example: All about technology
        id:
          $ref: '#/components/schemas/TopicId'
        name:
          type: string
          description: 指定されたトピックの名前。
          example: Technology
    User:
      type: object
      description: X の User オブジェクト。
      required:
        - id
        - name
        - username
      properties:
        affiliation:
          type: object
          description: ユーザーの所属に関するメタデータ。
          properties:
            badge_url:
              type: string
              description: 所属に対応するバッジの URL。
              format: uri
            description:
              type: string
              description: 所属の説明。
            url:
              type: string
              description: 所属の詳細情報への URL（存在する場合）。
              format: uri
            user_id:
              type: array
              minItems: 1
              items:
                $ref: '#/components/schemas/UserId'
        connection_status:
          type: array
          description: 2人のユーザー間の関係の詳細を返します。
          minItems: 0
          items:
            type: string
            description: ユーザー同士の関係の種類。
            enum:
              - follow_request_received
              - follow_request_sent
              - blocking
              - followed_by
              - following
              - muting
        created_at:
          type: string
          description: この User が作成された時刻。
          format: date-time
        description:
          type: string
          description: ユーザーが設定している場合、そのユーザーのプロフィールの説明文（「自己紹介」とも呼ばれます）のテキストです。
        entities:
          type: object
          description: ユーザーのプロフィールの説明文内で検出されたメタデータのリストです.
          properties:
            description:
              $ref: '#/components/schemas/FullTextEntities'
            url:
              type: object
              description: ユーザーのプロフィールで指定されている URL に関する、開始・終了インデックスを含む展開後の詳細情報です。
              properties:
                urls:
                  type: array
                  minItems: 1
                  items:
                    $ref: '#/components/schemas/UrlEntity'
        id:
          $ref: '#/components/schemas/UserId'
        location:
          type: string
          description: >-
            ユーザーがプロフィールで指定している場合の所在地です。これは自由入力の値であるため、必ずしも有効な所在地を示すとは限りませんが、位置情報クエリを用いた検索の際にあいまいに解釈されて利用される場合があります。
        most_recent_tweet_id:
          $ref: '#/components/schemas/TweetId'
        name:
          type: string
          description: ユーザーのプロフィールに表示される表示名です。
        pinned_tweet_id:
          $ref: '#/components/schemas/TweetId'
        profile_banner_url:
          type: string
          description: このユーザーのプロフィールバナーのURLです。
          format: uri
        profile_image_url:
          type: string
          description: このユーザーのプロフィール画像のURLです。
          format: uri
        protected:
          type: boolean
          description: このユーザーが自分の投稿を保護（つまり非公開）にする設定を選択しているかどうかを示します。
        public_metrics:
          type: object
          description: このユーザーに関する各種指標の一覧です。
          required:
            - followers_count
            - following_count
            - tweet_count
            - listed_count
          properties:
            followers_count:
              type: integer
              description: このユーザーをフォローしているユーザー数です。
            following_count:
              type: integer
              description: このユーザーがフォローしているユーザー数です。
            like_count:
              type: integer
              description: このユーザーが行ったいいねの数です。
            listed_count:
              type: integer
              description: このユーザーが含まれているリストの数です。
            tweet_count:
              type: integer
              description: このユーザーによるポスト（リツイートを含む）の数。
        receives_your_dm:
          type: boolean
          description: このユーザーにDMを送信できるかどうかを示します。
        subscription_type:
          type: string
          description: 'ユーザーの X Blue サブスクリプションの種類。例: Basic、Premium、PremiumPlus、None。'
          enum:
            - Basic
            - Premium
            - PremiumPlus
            - None
        url:
          type: string
          description: ユーザープロフィールで指定されている URL。
        username:
          $ref: '#/components/schemas/UserName'
        verified:
          type: boolean
          description: このユーザーが X で認証済みかどうかを示します。
        verified_type:
          type: string
          description: 'ユーザーの X Blue 認証種別。例: blue、government、business、none。'
          enum:
            - blue
            - government
            - business
            - none
        withheld:
          $ref: '#/components/schemas/UserWithheld'
      example:
        created_at: '2013-12-14T04:35:55Z'
        id: '2244994945'
        name: X Dev
        protected: false
        username: TwitterDev
    ContextAnnotationDomainFields:
      type: object
      description: コンテキストアノテーションドメインを表すデータ。
      required:
        - id
      properties:
        description:
          type: string
          description: コンテキストアノテーションドメインの説明。
        id:
          type: string
          description: コンテキスト注釈ドメインの一意の id。
          pattern: ^[0-9]{1,19}$
        name:
          type: string
          description: コンテキスト注釈ドメインの名前。
    ContextAnnotationEntityFields:
      type: object
      description: コンテキスト注釈エンティティのデータを表します。
      required:
        - id
      properties:
        description:
          type: string
          description: コンテキスト注釈エンティティの説明。
        id:
          type: string
          description: コンテキスト注釈エンティティの一意の id。
          pattern: ^[0-9]{1,19}$
        name:
          type: string
          description: コンテキスト注釈エンティティの名前。
    EntityIndicesInclusiveInclusive:
      type: object
      description: >-
        認識されたエンティティ（例：ハッシュタグやメンション）の境界範囲（開始インデックスと終了インデックス）を表します。`start` は `end`
        よりも小さい必要があります。開始インデックスと終了インデックスのどちらも、その位置を含みます。
      required:
        - start
        - end
      properties:
        end:
          type: integer
          description: このエンティティが終了する位置のインデックス（0 始まり）です。このインデックスはその位置を含みます。
          minimum: 0
          example: 61
        start:
          type: integer
          description: このエンティティが開始する位置のインデックス（0 始まり）です。このインデックスはその位置を含みます。
          minimum: 0
          example: 50
    Position:
      type: array
      description: >-
        `[経度, 緯度]` 形式の [GeoJSON
        Position](https://tools.ietf.org/html/rfc7946#section-3.1.1)。
      minItems: 2
      maxItems: 2
      items:
        type: number
      example:
        - -105.18816086351444
        - 40.247749999999996
    EntityIndicesInclusiveExclusive:
      type: object
      description: >-
        認識されたエンティティ（例: ハッシュタグやメンション）の境界（開始インデックスと終了インデックス）を表します。`start` は必ず
        `end`
        より小さい値でなければなりません。開始インデックスは「含む（inclusive）」であり、終了インデックスは「含まない（exclusive）」です。
      required:
        - start
        - end
      properties:
        end:
          type: integer
          description: このエンティティが終了する位置を示すインデックス（0 始まり）です。このインデックスは「含まない（exclusive）」です。
          minimum: 0
          example: 61
        start:
          type: integer
          description: このエンティティが開始する位置を示すインデックス（0 始まり）です。このインデックスは「含む（inclusive）」です。
          minimum: 0
          example: 50
    CashtagFields:
      type: object
      description: Cashtag として認識されたテキスト範囲と、そのテキスト内での開始位置および終了位置を表します。
      required:
        - tag
      properties:
        tag:
          type: string
          example: TWTR
    HashtagFields:
      type: object
      description: ハッシュタグとして認識されたテキスト部分と、そのテキスト内での開始位置および終了位置を表します。
      required:
        - tag
      properties:
        tag:
          type: string
          description: ハッシュタグのテキスト。
          example: MondayMotivation
    MentionFields:
      type: object
      description: テキスト内でユーザー言及として認識された部分と、その開始位置および終了位置を表します。
      required:
        - username
      properties:
        id:
          $ref: '#/components/schemas/UserId'
        username:
          $ref: '#/components/schemas/UserName'
    UrlFields:
      type: object
      description: URL として認識されたテキスト部分を表します。
      required:
        - url
      properties:
        description:
          type: string
          description: URL のランディングページの説明。
          example: This is a description of the website.
        display_url:
          type: string
          description: X クライアントで表示される URL。
          example: twittercommunity.com/t/introducing-…
        expanded_url:
          $ref: '#/components/schemas/Url'
        images:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/UrlImage'
        media_key:
          $ref: '#/components/schemas/MediaKey'
        status:
          $ref: '#/components/schemas/HttpStatusCode'
        title:
          type: string
          description: URL が指し示すページのタイトル。
          example: Introducing the v2 follow lookup endpoints
        unwound_url:
          type: string
          description: 最終的に解決された完全な URL。
          format: uri
          example: >-
            https://twittercommunity.com/t/introducing-the-v2-follow-lookup-endpoints/147118
        url:
          $ref: '#/components/schemas/Url'
    CountryCode:
      type: string
      description: 2 文字の ISO 3166-1 alpha-2 国コード。
      pattern: ^[A-Z]{2}$
      example: US
    MediaHeight:
      type: integer
      description: メディアの高さ（ピクセル単位）です。
      minimum: 0
    MediaWidth:
      type: integer
      description: メディアの幅（ピクセル単位）。
      minimum: 0
    AnimatedGif:
      allOf:
        - $ref: '#/components/schemas/Media'
        - type: object
          properties:
            preview_image_url:
              type: string
              format: uri
            variants:
              $ref: '#/components/schemas/Variants'
    Photo:
      allOf:
        - $ref: '#/components/schemas/Media'
        - type: object
          properties:
            alt_text:
              type: string
            url:
              type: string
              format: uri
    Video:
      allOf:
        - $ref: '#/components/schemas/Media'
        - type: object
          properties:
            duration_ms:
              type: integer
            non_public_metrics:
              type: object
              description: リクエスト時点におけるこのメディアの非公開エンゲージメント指標です。
              properties:
                playback_0_count:
                  type: integer
                  description: 動画の再生を開始したユーザー数。
                  format: int32
                playback_100_count:
                  type: integer
                  description: 動画を最後まで（100％）視聴したユーザー数。
                  format: int32
                playback_25_count:
                  type: integer
                  description: 動画を25％まで視聴したユーザー数。
                  format: int32
                playback_50_count:
                  type: integer
                  description: 動画を50％まで視聴したユーザー数。
                  format: int32
                playback_75_count:
                  type: integer
                  description: 動画を75％まで視聴したユーザー数。
                  format: int32
            organic_metrics:
              type: object
              description: リクエスト時点における、そのメディアのオーガニックな非公開エンゲージメント指標。
              properties:
                playback_0_count:
                  type: integer
                  description: 動画の再生を開始したユーザー数。
                  format: int32
                playback_100_count:
                  type: integer
                  description: 動画を最後まで（100％）再生したユーザー数。
                  format: int32
                playback_25_count:
                  type: integer
                  description: 動画を25％まで再生したユーザー数。
                  format: int32
                playback_50_count:
                  type: integer
                  description: 動画を50％まで再生したユーザー数。
                  format: int32
                playback_75_count:
                  type: integer
                  description: 動画を75％まで再生したユーザー数。
                  format: int32
                view_count:
                  type: integer
                  description: この動画が再生された回数。
                  format: int32
            preview_image_url:
              type: string
              format: uri
            promoted_metrics:
              type: object
              description: このメディアに対する、リクエスト時点におけるプロモーション済み非公開エンゲージメント指標。
              properties:
                playback_0_count:
                  type: integer
                  description: 動画の再生開始直後（0％時点）に離脱したユーザー数。
                  format: int32
                playback_100_count:
                  type: integer
                  description: 動画を最後まで再生したユーザー数。
                  format: int32
                playback_25_count:
                  type: integer
                  description: 動画を全体の25%まで再生したユーザー数。
                  format: int32
                playback_50_count:
                  type: integer
                  description: 動画を全体の50%まで再生したユーザー数。
                  format: int32
                playback_75_count:
                  type: integer
                  description: 動画を全体の75%まで再生したユーザー数。
                  format: int32
                view_count:
                  type: integer
                  description: この動画が再生された回数。
                  format: int32
            public_metrics:
              type: object
              description: リクエスト時点におけるメディアのエンゲージメント指標。
              properties:
                view_count:
                  type: integer
                  description: この動画が再生された回数。
                  format: int32
            variants:
              $ref: '#/components/schemas/Variants'
    Geo:
      type: object
      required:
        - type
        - bbox
        - properties
      properties:
        bbox:
          type: array
          minItems: 4
          maxItems: 4
          items:
            type: number
            minimum: -180
            maximum: 180
            format: double
          example:
            - -105.193475
            - 39.60973
            - -105.053164
            - 39.761974
        geometry:
          $ref: '#/components/schemas/Point'
        properties:
          type: object
        type:
          type: string
          enum:
            - Feature
    PlaceType:
      type: string
      enum:
        - poi
        - neighborhood
        - city
        - admin
        - country
        - unknown
      example: city
    PollOption:
      type: object
      description: Poll オブジェクト内の選択肢を表します。
      required:
        - position
        - label
        - votes
      properties:
        label:
          $ref: '#/components/schemas/PollOptionLabel'
        position:
          type: integer
          description: この選択肢が poll 内のどの位置にあるかを示す順序です。
        votes:
          type: integer
          description: この選択肢に投票したユーザー数です。
    TopicId:
      type: string
      description: このトピックの一意の識別子。
    UserWithheld:
      type: object
      description: >-
        [閲覧制限されたコンテンツ](https://help.twitter.com/en/rules-and-policies/tweet-withheld-by-country)
        に関する詳細を示します。
      required:
        - country_codes
      properties:
        country_codes:
          type: array
          description: このコンテンツを利用できない国の一覧を提供します。
          minItems: 1
          uniqueItems: true
          items:
            $ref: '#/components/schemas/CountryCode'
        scope:
          type: string
          description: この閲覧制限対象が `user` であることを示します。
          enum:
            - user
    Url:
      type: string
      description: 形式が正しい有効な URL。
      format: uri
      example: https://developer.twitter.com/en/docs/twitter-api
    UrlImage:
      type: object
      description: URL に関連付けられた画像に関する情報を表します。
      properties:
        height:
          $ref: '#/components/schemas/MediaHeight'
        url:
          $ref: '#/components/schemas/Url'
        width:
          $ref: '#/components/schemas/MediaWidth'
    HttpStatusCode:
      type: integer
      description: HTTP ステータスコード。
      minimum: 100
      maximum: 599
    Variants:
      type: array
      description: 利用可能なメディアのすべてのバリアントを格納した配列です。
      items:
        $ref: '#/components/schemas/Variant'
    PollOptionLabel:
      type: string
      description: poll の選択肢の本文テキストです。
      minLength: 1
      maxLength: 25
    Variant:
      type: object
      properties:
        bit_rate:
          type: integer
          description: メディアのビットレートです。
        content_type:
          type: string
          description: メディアのコンテンツタイプです。
        url:
          type: string
          description: メディアへの URL です。
          format: uri
  securitySchemes:
    BearerToken:
      type: http
      scheme: bearer

````