---
title: "Get Multiple Tweets by IDs - API Reference"
description: "Retrieve contents and stats for multiple tweets in one request. Flat-rate $0.0002 per tweet, flexible rate limits and no subscription plans."
source: "https://docs.socialdata.tools/reference/get-multiple-tweets/"
---

POST https://api.socialdata.tools/twitter/tweets-by-ids

## Headers

**Authorization** `string` — required

Authorization Bearer header containing your SocialData API key

Example: Bearer YOUR\_API\_KEY

## Path Parameters

**ids** `array` — required

An array of Twitter tweet IDs. Up to 100 IDs per request

Example: \["1922917671227498515", "1924473372236476749", ...\]

> **Caution**
> 
> When using languages where the `id` value exceeds the default Integer type limit (e.g., JavaScript), you should store `id` as a String. Use the `id_str` property returned by the API for these values

## Code Examples

#### curl

```shellscript
curl "https://api.socialdata.tools/twitter/tweets-by-ids" \
    -X POST \
    -H 'Authorization: Bearer YOUR_API_KEY' \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -d '{"ids": [1922917671227498515, 1924473372236476749]}'
```

#### JavaScript

```js
const ids = ["1922917671227498515", "1924473372236476749"];
const API_KEY = 'YOUR_API_KEY_HERE';

fetch('https://api.socialdata.tools/twitter/tweets-by-ids', {
    method: 'POST',
    headers: {
        'Authorization': `Bearer ${API_KEY}`,
        'Content-Type': 'application/json',
        'Accept': 'application/json'
    },
    body: JSON.stringify({ ids })
})
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
```

#### Python

```python
import requests

ids = [1922917671227498515, 1924473372236476749]
API_KEY = 'YOUR_API_KEY_HERE'

url = 'https://api.socialdata.tools/twitter/tweets-by-ids'

headers = {
    'Authorization': f'Bearer {API_KEY}',
    'Content-Type': 'application/json',
    'Accept': 'application/json'
}

payload = {'ids': ids}

response = requests.post(url, json=payload, headers=headers)

if response.status_code == 200:
    data = response.json()
    print(data)
else:
    print(f"Error: {response.status_code}")
    print(response.text)
```

#### PHP

```php
$ids = [1922917671227498515, 1924473372236476749];
$API_KEY = 'YOUR_API_KEY_HERE';

$url = "https://api.socialdata.tools/twitter/tweets-by-ids";

$ch = curl_init();

curl_setopt_array($ch, [
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => json_encode(['ids' => $ids]),
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer $API_KEY",
        "Content-Type: application/json",
        "Accept: application/json"
    ]
]);

$response = curl_exec($ch);
$data = json_decode($response, true);
print_r($data);

curl_close($ch);
```

## Example Responses

#### 200

```json
[
    {
        "tweet_created_at": "2022-07-19T06:35:54+00:00",
        "id": 1549281861687451648,
        "id_str": "1549281861687451648",
        "text": null,
        "full_text": "100 tips I learned growing an iOS app to ~$5M in sales in 3 yrs, going through YC 1.5 times, and co-founding @Superwall 👇",
        "source": "<a href=\"https:\/\/getchirrapp.com\" rel=\"nofollow\">chirr.app<\/a>",
        "truncated": false,
        "in_reply_to_status_id": null,
        "in_reply_to_status_id_str": null,
        "in_reply_to_user_id": null,
        "in_reply_to_user_id_str": null,
        "in_reply_to_screen_name": null,
        "user": {
            "id": 15118774,
            "id_str": "15118774",
            "name": "Jake Mor",
            "screen_name": "jakemor",
            "location": "New York, USA",
            "url": "http:\/\/superwall.com",
            "description": "CEO @Superwall — build & test paywalls without shipping updates. Past: Founder @FitnessAI_ (acquired). YC W20 & S21",
            "protected": false,
            "verified": true,
            "followers_count": 5423,
            "friends_count": 556,
            "listed_count": 95,
            "favourites_count": 1161,
            "statuses_count": 1683,
            "created_at": "2008-06-14T18:37:41+00:00",
            "profile_banner_url": "https:\/\/pbs.twimg.com\/profile_banners\/15118774\/1636564314",
            "profile_image_url_https": "https:\/\/pbs.twimg.com\/profile_images\/1167559170540875777\/nRn7p8em_normal.jpg",
            "can_dm": true
        },
        "quoted_status_id": null,
        "quoted_status_id_str": null,
        "is_quote_status": false,
        "quoted_status": null,
        "retweeted_status": null,
        "quote_count": 73,
        "reply_count": 105,
        "retweet_count": 492,
        "favorite_count": 9419,
        "views_count": null,
        "bookmark_count": 4614,
        "lang": "en",
        "entities": {
            "user_mentions": [
                {
                    "id_str": "1427520876325613571",
                    "name": "Superwall",
                    "screen_name": "Superwall",
                    "indices": [
                        109,
                        119
                    ]
                }
            ],
            "urls": [],
            "hashtags": [],
            "symbols": []
        },
        "is_pinned": false
    },
    // ...
]
```

#### 402

```json
{
    "status": "error",
    "message": "Insufficient balance"
}
```

#### 500

```json
{
    "status": "error",
    "message": "Failed to fetch data from Twitter"
}
```

## Response Codes

-   **200 OK** - request succeeded
-   **402 Payment Required** - not enough credits to perform this request
-   **404 Not Found** - requested tweet does not exist
-   **422 Unprocessable Content** - validation failed (e.g. one of the required parameters was not provided)
-   **500 Internal Error** - API internal error, typically means that SocialData API failed to obtain the requested information and you should try again later

## Related endpoints

-   [Get tweet](https://docs.socialdata.tools/reference/get-tweet/)
-   [Get thread](https://docs.socialdata.tools/reference/get-tweet-thread/)
-   [Get article](https://docs.socialdata.tools/reference/get-tweet-article/)

## Before you integrate

-   [Authentication](https://docs.socialdata.tools/getting-started/authentication/)
-   [Rate limits](https://docs.socialdata.tools/getting-started/rate-limits/)
-   [Errors](https://docs.socialdata.tools/getting-started/errors/)
-   [Pricing](https://docs.socialdata.tools/getting-started/pricing/)
