---
title: "Replay stored events"
canonical_url: "https://tweetstream.io/docs/api/get-history"
last_updated: 2026-11-05
---

# Replay stored events

Returns stored events newest first. Repeat handle parameters or use comma-separated values.

Canonical URL: https://tweetstream.io/docs/api/get-history

## `GET /api/history`

`https://api.tweetstream.io/api/history`

## Authorization

| Name | Type | Description |
| --- | --- | --- |
| `Authorization` | `string`, required | Bearer authentication with your TweetStream API key: `Bearer <key>`. |

## Query parameters

| Name | Type | Description |
| --- | --- | --- |
| `handle` | `string` | Tracked handle. Repeat or provide a comma-separated list. |
| `handles` | `string` | Alias for handle. Repeat or provide a comma-separated list. |
| `handle[]` | `string[]` | Array-style alias for handle. |
| `handles[]` | `string[]` | Array-style alias for handles. |
| `cursor` | `string` | Stable cursor returned by a previous history page. |
| `startDate` | `string` |  |
| `endDate` | `string` |  |
| `limit` | `integer` |  |
| `type` | `enum<string>` |  |

## Response fields

| Name | Type | Description |
| --- | --- | --- |
| `data` | `object[]`, required |  |
| `data.body` | `string`, required |  |
| `data.content` | `object`, required |  |
| `data.link` | `string`, required |  |
| `data.messageType` | `enum<string>`, required |  |
| `data.meta` | `object` |  |
| `data.receivedTime` | `string`, required |  |
| `data.time` | `string`, required |  |
| `data.tweetId` | `string`, required |  |
| `data.twitterHandle` | `string \| null`, required |  |
| `data.twitterId` | `string`, required |  |
| `metadata` | `object`, required |  |
| `metadata.count` | `integer`, required |  |
| `metadata.endDate` | `string` |  |
| `metadata.handle` | `string` |  |
| `metadata.handles` | `string[]` |  |
| `metadata.nextCursor` | `string \| null`, required |  |
| `metadata.startDate` | `string` |  |
| `metadata.type` | `enum<string>` |  |

## Responses

| Status | Description | Headers |
| --- | --- | --- |
| `200` | Success |  |
| `400` | Invalid request |  |
| `401` | Missing or invalid API key |  |
| `403` | The authenticated account cannot use this capability |  |
| `429` | Rate limit reached |  |
| `500` | The request could not be completed |  |

### 200

```json
{
  "data": [
    {
      "tweetId": "account:affiliate:aff_01JQ8YQ5K8B8QKH6M0P8A1V2WX",
      "twitterId": "123",
      "twitterHandle": "organization",
      "body": "Added New Member (@newmember) to affiliate list",
      "time": "2025-04-09T00:00:00.123Z",
      "receivedTime": "2025-04-09T00:00:00.123Z",
      "link": "https://x.com/newmember",
      "messageType": "AFFILIATE",
      "content": {
        "action": "added",
        "eventId": "aff_01JQ8YQ5K8B8QKH6M0P8A1V2WX",
        "observedAt": 1744156800123,
        "receivedAt": 1744156800123,
        "organization": {
          "id": "123",
          "handle": "@organization",
          "name": "Organization",
          "verifiedType": "business"
        },
        "member": {
          "id": "456",
          "handle": "@newmember",
          "name": "New Member",
          "profileImage": "https://pbs.twimg.com/profile_images/newmember_normal.jpg"
        }
      }
    }
  ],
  "metadata": {
    "count": 1,
    "nextCursor": null,
    "type": "AFFILIATE"
  }
}
```

### 400

```json
{
  "error": "<string>"
}
```

### 401

```json
{
  "error": "<string>"
}
```

### 403

```json
{
  "error": "<string>"
}
```

### 429

```json
{
  "error": "<string>",
  "retryAfterSeconds": 0
}
```

### 500

```json
{
  "error": "<string>"
}
```

## Code samples

### cURL

```bash
curl --request GET \
  --url https://api.tweetstream.io/api/history \
  --header "Authorization: Bearer $TWEETSTREAM_API_KEY"
```

### JavaScript

```javascript
const response = await fetch("https://api.tweetstream.io/api/history", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.TWEETSTREAM_API_KEY}`,
  },
});

console.log(response.status, await response.json());
```

### Python

```python
import os
import requests

response = requests.get(
    "https://api.tweetstream.io/api/history",
    headers={"Authorization": f"Bearer {os.environ['TWEETSTREAM_API_KEY']}"},
)

print(response.status_code, response.json())
```
