streaming
Subscribe to server-sent events for real-time updates via a long-lived HTTP connection or via WebSocket.
Last updated
Was this helpful?
Subscribe to server-sent events for real-time updates via a long-lived HTTP connection or via WebSocket.
Last updated
Was this helpful?
Your application can use a endpoint to receive updates in real-time. Server-sent events is an incredibly simple transport method that relies entirely on chunked-encoding transfer, i.e. the HTTP connection is kept open and receives new data periodically.
Alternatively, a WebSocket connection can also be established.
Returns OK
when streaming service is fine. Added in 2.5.0
Returns events that are relevant to the authorized user, i.e. home timeline and notifications
Returns all public statuses
Returns all local statuses
Returns all public statuses for a particular hashtag
Returns all local statuses for a particular hashtag
Returns statuses for a list
Returns all direct messages
The stream will contain events as well as heartbeat comments. Lines that begin with a colon (:
) can be ignored by parsers, they are simply there to keep the connection open. Events have this structure:
For WebSockets, there is only one URL path (/api/v1/streaming
). The access token as well as the endpoint you are interested in must be provided with query params, respectively access_token
and stream
. Query params list
and tag
are likewise supported for relevant endpoints.
Possible stream
values:
user
public
public:local
hashtag
hashtag:local
list
direct
Event
Description
What’s in the payload
update
A new status has appeared
notification
A new notification has appeared
delete
A status has been deleted
ID of the deleted status
filters_changed
Keyword filters have been changed
The payload is JSON-encoded.