Sample stream
GET
/2/tweets/sample/streamStreams a deterministic 1% of public Tweets.
Request
Query Params
expansions
array[string]
optional
A comma separated list of fields to expand.
tweet.fields
array[string]
optional
A comma separated list of Tweet fields to display.
user.fields
array[string]
optional
A comma separated list of User fields to display.
media.fields
array[string]
optional
A comma separated list of Media fields to display.
place.fields
array[string]
optional
A comma separated list of Place fields to display.
poll.fields
array[string]
optional
A comma separated list of Poll fields to display.
backfill_minutes
integer
optional
The number of minutes of backfill requested
Request samples
Responses
The request was successful. Successful responses will return a stream of individual JSON Tweet payloads.(200)
500(500)
The request was successful. Successful responses will return a stream of individual JSON Tweet payloads.
HTTP Code: 200
Content Type : JSONapplication/json
Data Schema
StreamingTweet
A tweet or error that can be returned by the streaming tweet API.
One of
data
object
Tweet
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 Twitter API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i"}
errors
array[null (Problem) {17}]
optional
>= 1 items
includes
object
Expansions
Example
{
"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": "city"
}
],
"polls": [
{
"duration_minutes": 0,
"end_datetime": "2019-08-24T14:15:22.123Z",
"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"
}
]
}
}
Last modified: 2 years ago