Twitter API v2 copy
  1. Tweets
Twitter API v2 copy
  • General
    • Returns the open api spec document.
      GET
  • Spaces
    • Space lookup up Space IDs
      GET
    • Space lookup by their creators
      GET
    • Search for Spaces
      GET
    • Space lookup by Space ID
      GET
  • Tweets
    • Tweet lookup by Tweet IDs
      GET
    • Full archive search counts
      GET
    • Recent search counts
      GET
    • Sample stream
      GET
    • Full-archive search
      GET
    • Recent search
      GET
    • Filtered stream
      GET
    • Rules lookup
      GET
    • Add/Delete rules
      POST
    • Tweet lookup by Tweet ID
      GET
    • Hide replies
      PUT
    • Returns Tweet objects liked by the provided User ID
      GET
    • Causes the user (in the path) to like the specified tweet
      POST
    • Causes the user (in the path) to unlike the specified tweet
      DELETE
    • User mention timeline by User ID
      GET
    • Causes the user (in the path) to retweet the specified tweet
      POST
    • Causes the user (in the path) to unretweet the specified tweet
      DELETE
    • User Tweets timeline by User ID
      GET
  • Users
    • Returns user objects that have liked the provided Tweet ID
      GET
    • Returns user objects that have retweeted the provided Tweet ID
      GET
    • User lookup by IDs
      GET
    • User lookup by usernames
      GET
    • User lookup by username
      GET
    • User lookup by ID
      GET
    • Returns user objects that are blocked by provided user ID
      GET
    • Block User by User ID
      POST
    • Returns user objects that follow the provided user ID
      GET
    • Following by User ID
      GET
    • Follow User
      POST
    • Mute User by User ID
      POST
    • Unblock User by User ID
      DELETE
    • Unfollow User
      DELETE
    • Unmute User by User ID
      DELETE
  • Schemas
    • Schemas
      • AddOrDeleteRulesRequest
      • AddOrDeleteRulesResponse
      • AddRulesRequest
      • AddRulesResponse
      • AnimatedGif
      • CashtagEntity
      • CashtagFields
      • ClientDisconnectedProblem
      • ClientForbiddenProblem
      • CommonMediaFields
      • ComplianceJob
      • ComplianceJobName
      • ComplianceJobStatus
      • ComplianceJobType
      • ConflictProblem
      • ConnectionExceptionProblem
      • ContextAnnotation
      • ContextAnnotationDomainFields
      • ContextAnnotationEntityFields
      • CountryCode
      • CreatedAt
      • DeleteRulesRequest
      • DeleteRulesResponse
      • DisallowedResourceProblem
      • DownloadExpiration
      • DownloadUrl
      • DuplicateRuleProblem
      • End
      • EntityIndicesInclusiveExclusive
      • EntityIndicesInclusiveInclusive
      • Error
      • Expansions
      • FieldUnauthorizedProblem
      • FilteredStreamingTweet
      • FullTextEntities
      • GenericMultipleUsersLookupResponse
      • GenericProblem
      • GenericTweetsTimelineResponse
      • Geo
      • Granularity
      • HTTPStatusCode
      • HashtagEntity
      • HashtagFields
      • InvalidRequestProblem
      • InvalidRuleProblem
      • JobId
      • Media
      • MediaHeight
      • MediaKey
      • MediaWidth
      • MentionEntity
      • MentionFields
      • MultiComplianceJobResponse
      • MultiSpaceLookupResponse
      • MultiTweetLookupResponse
      • MultiUserLookupResponse
      • OperationalDisconnectProblem
      • Photo
      • Place
      • PlaceId
      • PlaceType
      • Point
      • Poll
      • PollId
      • PollOption
      • Position
      • Problem
      • ProblemFields
      • ReplySettings
      • ResourceNotFoundProblem
      • ResourceUnauthorizedProblem
      • ResourceUnavailableProblem
      • Rule
      • RuleId
      • RuleNoId
      • RuleTag
      • RuleValue
      • RulesCapProblem
      • RulesRequestSummary
      • RulesResponseMetadata
      • SearchCount
      • SingleComplianceJobResponse
      • SingleSpaceLookupResponse
      • SingleTweetLookupResponse
      • SingleUserLookupResponse
      • Space
      • SpaceID
      • Start
      • StreamingTweet
      • Tweet
      • TweetCount
      • TweetCountsResponse
      • TweetDeleteResponse
      • TweetID
      • TweetSearchResponse
      • TweetWithheld
      • URL
      • URLFields
      • URLImage
      • UnsupportedAuthenticationProblem
      • UploadExpiration
      • UploadUrl
      • UrlEntity
      • UsageCapExceededProblem
      • User
      • UserID
      • UserName
      • UserWithheld
      • UsersBlockingMutationResponse
      • UsersFollowingCreateResponse
      • UsersFollowingDeleteResponse
      • UsersFollowingLookupResponse
      • UsersLikesCreateRequest
      • UsersLikesCreateResponse
      • UsersLikesDeleteResponse
      • UsersMutingMutationResponse
      • UsersRetweetsCreateRequest
      • UsersRetweetsCreateResponse
      • UsersRetweetsDeleteResponse
      • Video
    • Response
      • HttpErrorResponse
  1. Tweets

Sample stream

GET
/2/tweets/sample/stream
Streams a deterministic 1% of public Tweets.

Request

Query Params

Responses

🟢200The request was successful. Successful responses will return a stream of individual JSON Tweet payloads.
application/json
Body

🔴500500
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET '/2/tweets/sample/stream'
Response Response Example
200 - Example 1
{
    "data": {
        "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 Twitter API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i"
    },
    "errors": [
        {
            "detail": "string",
            "title": "string",
            "status": 0,
            "type": "about:blank"
        }
    ],
    "includes": {
        "media": [
            {
                "height": 0,
                "media_key": "string",
                "width": 0,
                "alt_text": "string",
                "type": "photo",
                "url": "http://example.com"
            }
        ],
        "places": [
            {
                "contained_within": [
                    "f7eb2fa2fea288b1"
                ],
                "country": "United States",
                "country_code": "US",
                "full_name": "Lakewood, CO",
                "geo": {
                    "bbox": [
                        -105.193475,
                        39.60973,
                        -105.053164,
                        39.761974
                    ],
                    "geometry": {
                        "coordinates": [
                            -105.18816086351444,
                            40.247749999999996
                        ],
                        "type": "Point"
                    },
                    "properties": {},
                    "type": "Feature"
                },
                "id": "f7eb2fa2fea288b1",
                "name": "Lakewood",
                "place_type": "poi"
            }
        ],
        "polls": [
            {
                "duration_minutes": 0,
                "end_datetime": "2019-08-24T14:15:22Z",
                "id": "1365059861688410112",
                "options": [
                    {
                        "label": "string",
                        "position": 0,
                        "votes": 0
                    },
                    {
                        "label": "string",
                        "position": 0,
                        "votes": 0
                    }
                ],
                "voting_status": "open"
            }
        ],
        "tweets": [
            {
                "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 Twitter API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i"
            }
        ],
        "users": [
            {
                "created_at": "2013-12-14T04:35:55Z",
                "id": "2244994945",
                "name": "Twitter Dev",
                "protected": false,
                "username": "TwitterDev"
            }
        ]
    }
}
Modified at 2025-07-31 05:59:41
Previous
Recent search counts
Next
Full-archive search
Built with