# Tweets by IDs

`GET https://api.twittrapi.com/tweet/tweets/by/ids`

Up to 100 tweets by ID in one call.

HTML page: https://www.twittrapi.com/docs/reference/tweet-tweets-by-ids

## Parameters

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `ids` | query | string (comma-separated) | yes |  | Numeric tweet IDs separated by commas. At most 100. |

This endpoint also accepts `format=simple` (or the header `X-Response-Format: simple`) for compact, flat JSON with a fixed schema. Same price.

## Response

Raw JSON of X's TweetResultsByRestIds query (data.tweetResult, one entry per ID in request order). An ID without a tweet, for example a deleted one, is an empty object.

With `format=simple`: Collection of Tweet objects in request order, without cursors (hasNextPage false). IDs without a tweet are left out.

## Errors

| Status | When |
| --- | --- |
| 400 | ids is missing, or has more than 100 IDs. |
| 422 | One of the IDs is not numeric. |

Shared errors (401 missing key, 402 no balance, 429 rate limit, 5xx) are listed on https://www.twittrapi.com/docs/helpful-infos/error-handling. Calls that fail with 400, 407, 408, 409 or a 5xx error are refunded.

## Example request

curl:

```bash
curl 'https://api.twittrapi.com/tweet/tweets/by/ids?ids=2019881223666233717,20' \
  --header 'X-API-KEY: YOUR_API_KEY'
```

Python:

```python
from twittrapi import TwittrAPI

client = TwittrAPI(api_key="YOUR_API_KEY")
data = client.tweets.get_many(["2019881223666233717", "20"])
```

Node.js:

```js
import { TwittrAPI } from "twittrapi";

const client = new TwittrAPI({ apiKey: process.env.TWITTRAPI_API_KEY });
const data = await client.tweets.getMany(["2019881223666233717", "20"]);
```

RapidAPI:

```bash
curl 'https://twitter-aio.p.rapidapi.com/tweet/tweets/by/ids?ids=2019881223666233717,20' \
  --header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY' \
  --header 'x-rapidapi-host: twitter-aio.p.rapidapi.com'
```

## Example response

Shortened: arrays keep their first items and long strings are cut.

Raw (default):

```json
{
  "data": {
    "tweetResult": [
      {
        "result": {
          "__typename": "Tweet",
          "card": {
            "legacy": {
              "binding_values": [
                {
                  "key": "photo_image_full_size_large",
                  "value": {
                    "image_value": {
                      "height": 419,
                      "url": "https://pbs.twimg.com/card_img/2107952823128182784/RyT0hE6P?format=jpg&name=800x419",
                      "width": 800
                    },
                    "type": "IMAGE"
                  }
                },
                "… 2 more"
              ],
              "card_platform": {
                "platform": {
                  "audience": {
                    "name": "production"
                  },
                  "device": {
                    "name": "Swift",
                    "version": "12"
                  }
                }
              },
              "name": "summary_large_image",
              "url": "https://t.co/FS66GuIYJD",
              "user_refs_results": []
            },
            "rest_id": "https://t.co/FS66GuIYJD"
          },
          "core": {
            "user_results": {
              "result": {
                "__typename": "User",
                "affiliates_highlighted_label": {
                  "label": {
                    "badge": {
                      "url": "https://pbs.twimg.com/profile_images/1955359038532653056/OSHY3ewP_bigger.jpg"
                    },
                    "description": "X",
                    "url": {
                      "url": "https://twitter.com/X",
                      "urlType": "DeepLink"
                    },
                    "userLabelDisplayType": "Badge",
                    "userLabelType": "BusinessLabel"
                  }
                },
                "has_graduated_access": true,
                "id": "VXNlcjoyMjQ0OTk0OTQ1",
                "is_blue_verified": true,
                "legacy": {
                  "blocked_by": false,
                  "blocking": false,
                  "can_dm": true,
                  "can_media_tag": true,
                  "created_at": "Sat Dec 14 04:35:55 +0000 2013",
                  "default_profile": false,
                  "default_profile_image": false,
                  "description": "The voice of the X Dev team and your official source for updates, news, and events, related to the X API.",
                  "entities": {
                    "description": {},
                    "url": {
                      "urls": [
                        {
                          "display_url": "docs.x.com",
                          "expanded_url": "https://docs.x.com/",
                          "indices": [
                            0,
                            23
                          ],
                          "url": "https://t.co/NIwHVIVyrN"
                        }
                      ]
                    }
                  },
                  "fast_followers_count": 0,
                  "favourites_count": 2758,
                  "follow_request_sent": false,
                  "followed_by": false,
                  "followers_count": 698074,
… (111 more lines)
```

Simple (`format=simple`):

```json
{
  "data": [
    {
      "id": "2019881223666233717",
      "url": "https://x.com/XDevelopers/status/2019881223666233717",
      "text": "Officially launching X API Pay-Per-Use\n\nThe core of X developers are indie builders, early stage products, startups, and hobbyists\n\nIt’s time to open up our X API ecosystem and instill a new wave of n…",
      "createdAt": "2026-02-06T21:09:45Z",
      "lang": "en",
      "author": {
        "id": "2244994945",
        "username": "XDevelopers",
        "name": "Developers",
        "description": "The voice of the X Dev team and your official source for updates, news, and events, related to the X API.",
        "location": "127.0.0.1",
        "url": "https://docs.x.com/",
        "createdAt": "2013-12-14T04:35:55Z",
        "avatarUrl": "https://pbs.twimg.com/profile_images/1683501992314798080/xl1POYLw.jpg",
        "bannerUrl": "https://pbs.twimg.com/profile_banners/2244994945/1690213128",
        "verified": true,
        "verifiedType": "Business",
        "protected": false,
        "counts": {
          "followers": 698074,
          "following": 770,
          "tweets": 4376,
          "likes": 2758,
          "media": 832,
          "listed": 2977
        },
        "pinnedTweetIds": [
          "2019881223666233717"
        ],
        "isAutomated": false
      },
      "counts": {
        "likes": 5599,
        "retweets": 896,
        "replies": 791,
        "quotes": 596,
        "bookmarks": 2803,
        "views": 2552260
      },
      "media": [],
      "urls": [
        "http://developer.x.com"
      ],
      "hashtags": [],
      "mentions": [],
      "replyTo": null,
      "quoted": null,
      "retweetOf": null,
      "conversationId": "2019881223666233717",
      "isPinned": false,
      "source": null,
      "article": null
    },
    "… 1 more"
  ],
  "nextCursor": null,
  "previousCursor": null,
  "hasNextPage": false
}
```
