X (Twitter) · Schema

FilteredStreamingTweetResponse

A Tweet or error that can be returned by the streaming Tweet API. The values returned with a successful streamed Tweet includes the user provided rules that the Tweet matched.

Social MediaMicrobloggingReal-Time DataStreamingAdvertisingContent

Properties

Name Type Description
data object
errors array
includes object
matching_rules array The list of rules which matched the Tweet
View JSON Schema on GitHub

JSON Schema

x-api-filtered-streaming-tweet-response-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/twitter/refs/heads/main/json-schema/x-api-filtered-streaming-tweet-response-schema.json",
  "title": "FilteredStreamingTweetResponse",
  "description": "A Tweet or error that can be returned by the streaming Tweet API. The values returned with a successful streamed Tweet includes the user provided rules that the Tweet matched.",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "attachments": {
          "type": "object",
          "description": "Specifies the type of attachments (if any) present in this Tweet.",
          "properties": {
            "media_keys": {
              "type": "array",
              "description": "A list of Media Keys for each one of the media attachments (if media are attached).",
              "minItems": 1,
              "items": {
                "$ref": "#/components/schemas/MediaKey"
              }
            },
            "media_source_tweet_id": {
              "type": "array",
              "description": "A list of Posts the media on this Tweet was originally posted in. For example, if the media on a tweet is re-used in another Tweet, this refers to the original, source Tweet..",
              "minItems": 1,
              "items": {
                "$ref": "#/components/schemas/TweetId"
              }
            },
            "poll_ids": {
              "type": "array",
              "description": "A list of poll IDs (if polls are attached).",
              "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": "Creation time of the Tweet.",
          "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": "Time when Tweet is no longer editable.",
              "format": "date-time",
              "example": "2021-01-06T18:40:40.000Z"
            },
            "edits_remaining": {
              "type": "integer",
              "description": "Number of times this Tweet can be edited."
            },
            "is_edit_eligible": {
              "type": "boolean",
              "description": "Indicates if this Tweet is eligible to be edited.",
              "example": false
            }
          }
        },
        "edit_history_tweet_ids": {
          "type": "array",
          "description": "A list of Tweet Ids in this Tweet chain.",
          "minItems": 1,
          "items": {
            "$ref": "#/components/schemas/TweetId"
          }
        },
        "entities": {
          "$ref": "#/components/schemas/FullTextEntities"
        },
        "geo": {
          "type": "object",
          "description": "The location tagged on the Tweet, if the user provided one.",
          "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": "Language of the Tweet, if detected by X. Returned as a BCP47 language tag.",
          "example": "en"
        },
        "non_public_metrics": {
          "type": "object",
          "description": "Nonpublic engagement metrics for the Tweet at the time of the request.",
          "properties": {
            "impression_count": {
              "type": "integer",
              "description": "Number of times this Tweet has been viewed.",
              "format": "int32"
            }
          }
        },
        "note_tweet": {
          "type": "object",
          "description": "The full-content of the Tweet, including text beyond 280 characters.",
          "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": "Organic nonpublic engagement metrics for the Tweet at the time of the request.",
          "required": [
            "impression_count",
            "retweet_count",
            "reply_count",
            "like_count"
          ],
          "properties": {
            "impression_count": {
              "type": "integer",
              "description": "Number of times this Tweet has been viewed."
            },
            "like_count": {
              "type": "integer",
              "description": "Number of times this Tweet has been liked."
            },
            "reply_count": {
              "type": "integer",
              "description": "Number of times this Tweet has been replied to."
            },
            "retweet_count": {
              "type": "integer",
              "description": "Number of times this Tweet has been Retweeted."
            }
          }
        },
        "possibly_sensitive": {
          "type": "boolean",
          "description": "Indicates if this Tweet contains URLs marked as sensitive, for example content suitable for mature audiences.",
          "example": false
        },
        "promoted_metrics": {
          "type": "object",
          "description": "Promoted nonpublic engagement metrics for the Tweet at the time of the request.",
          "properties": {
            "impression_count": {
              "type": "integer",
              "description": "Number of times this Tweet has been viewed.",
              "format": "int32"
            },
            "like_count": {
              "type": "integer",
              "description": "Number of times this Tweet has been liked.",
              "format": "int32"
            },
            "reply_count": {
              "type": "integer",
              "description": "Number of times this Tweet has been replied to.",
              "format": "int32"
            },
            "retweet_count": {
              "type": "integer",
              "description": "Number of times this Tweet has been Retweeted.",
              "format": "int32"
            }
          }
        },
        "public_metrics": {
          "type": "object",
          "description": "Engagement metrics for the Tweet at the time of the request.",
          "required": [
            "retweet_count",
            "reply_count",
            "like_count",
            "impression_count",
            "bookmark_count"
          ],
          "properties": {
            "bookmark_count": {
              "type": "integer",
              "description": "Number of times this Tweet has been bookmarked.",
              "format": "int32"
            },
            "impression_count": {
              "type": "integer",
              "description": "Number of times this Tweet has been viewed.",
              "format": "int32"
            },
            "like_count": {
              "type": "integer",
              "description": "Number of times this Tweet has been liked."
            },
            "quote_count": {
              "type": "integer",
              "description": "Number of times this Tweet has been quoted."
            },
            "reply_count": {
              "type": "integer",
              "description": "Number of times this Tweet has been replied to."
            },
            "retweet_count": {
              "type": "integer",
              "description": "Number of times this Tweet has been Retweeted."
            }
          }
        },
        "referenced_tweets": {
          "type": "array",
          "description": "A list of Posts this Tweet refers to. For example, if the parent Tweet is a Retweet, a Quoted Tweet or a Reply, it will include the related Tweet referenced to by its parent.",
          "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": "The scopes for this tweet",
          "properties": {
            "followers": {
              "type": "boolean",
              "description": "Indicates if this Tweet is viewable by followers without the Tweet ID",
              "example": false
            }
          }
        },
        "source": {
          "type": "string",
          "description": "This is deprecated."
        },
        "suggested_source_links": {
          "type": "array",
          "minItems": 0,
          "items": {
            "$ref": "#/components/schemas/UrlEntity"
          }
        },
        "suggested_source_links_with_counts": {
          "type": "object",
          "description": "Suggested source links and the number of requests that included each link.",
          "properties": {
            "count": {
              "type": "integer",
              "description": "Number of note requests that included the source link."
            },
            "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"
      }
    },
    "errors": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/components/schemas/Problem"
      }
    },
    "includes": {
      "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"
          }
        }
      }
    },
    "matching_rules": {
      "type": "array",
      "description": "The list of rules which matched the Tweet",
      "items": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/RuleId"
          },
          "tag": {
            "$ref": "#/components/schemas/RuleTag"
          }
        }
      }
    }
  }
}