ENTERPRISE
Method | Description |
---|---|
GET /{stream-type}/:stream | Connect to the data stream |
Request Method | HTTP GET |
Connection Type | Keep-Alive This should be specified in the header of the request. |
URL | Found on the stream’s API Help page of your dashboard, using the following structure: Decahose: https://gnip-stream.x.com/stream/sample10/accounts/:account_name/publishers/twitter/:stream_label.json?partition=1 |
Partition (required) | partition=\{#} - Partitioning is now required in order to consume the full stream. You will need to connect to the stream with the partition parameter specified. Below is the number of partitions per stream:* Decahose: 2 partitions |
Compression | Gzip. To connect to the stream using Gzip compression, simply send an Accept-Encoding header in the connection request. The header should look like the following: Accept-Encoding: gzip |
Character Encoding | UTF-8 |
Response Format | JSON. The header of your request should specify JSON format for the response. |
Rate Limit | 10 requests per 60 seconds. |
Backfill Parameter | If you have purchased a stream with Backfill enabled, you’ll need to add the “backfillMinutes” parameter into GET request to enable it. |
Read Timeout | Set a read timeout on your client, and ensure that it is set to a value beyond 30 seconds. |
Support for Tweet edits | All Tweet objects will include Tweet edit metadata describing the Tweet’s edit history. See the “Edit Tweets” fundamentals page for more details. |
Status | Text | Description |
---|---|---|
200 | Success | The connection was successfully opened, and new activities will be sent through as they arrive. |
401 | Unauthorized | HTTP authentication failed due to invalid credentials. Log in to console.gnip.com with your credentials to ensure you are using them correctly with your request. |
406 | Not Acceptable | Generally, this occurs where your client fails to properly include the headers to accept gzip encoding from the stream, but can occur in other circumstances as well. Will contain a JSON message similar to “This connection requires compression. To enable compression, send an ‘Accept-Encoding: gzip’ header in your request and be ready to uncompress the stream as it is read on the client end.” |
429 | Rate Limited | Your app has exceeded the limit on connection requests. |
503 | Service Unavailable | Twitter server issue. Reconnect using an exponential backoff pattern. If no notice about this issue has been posted on the X API Status Page, contact support or emergency if unable to connect after 10 minutes. |