# X (Twitter) Profiles by user ID API (twitter.profiles_by_ids)

- Canonical page: https://everyinfra.com/en/twitter-api/profiles_by_ids
- Endpoint: POST /api/v1/social with {"platform": "twitter", "action": "profiles_by_ids", "params": {...}}
- Price: $0.000806 per call ($0.81 per 1,000 requests); failed and empty results are not charged
- Returns: list, default 20, max 20 per call
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=twitter&action=profiles_by_ids

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| user_ids | not declared | yes | not declared | Numeric X user IDs for `profiles_by_ids`, 1 to 20, as a list or a comma-separated string, such as `44196397,11348282`. |
| limit | integer (1–20) | no | 20 | The most rows to return in this call, an integer from 1 to 20. The default applies when you leave it out, and a call can return fewer rows. Larger values return 422 before any charge. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| user_id | User's unique ID on the platform. |
| username | Username (@handle). |
| display_name | Display name; can differ from username. |
| url | Link to the record on the platform. |
| location | Location description passed through as is; the format varies by platform. |
| is_verified | Whether the platform verified the account. null means it cannot be determined. |
| is_protected | platform-native meaning |
| affiliation | platform-native meaning |
| avatar_url | Avatar image link. Some platforms return sized CDN links that can expire. |
| created_at | Creation time, same format as posted_at. |
| account_status | platform-native meaning |
| platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "twitter",
  "action": "profiles_by_ids",
  "params": {
    "user_ids": [
      "44196397",
      "11348282"
    ]
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "twitter",
        "action": "profiles_by_ids",
        "params": {
            "user_ids": [
                "44196397",
                "11348282",
            ],
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "twitter",
  "action": "profiles_by_ids",
  "results": [
    {
      "user_id": …,
      "username": …,
      "display_name": …,
      "url": …,
      "location": …,
      "is_verified": …,
      "is_protected": …,
      "affiliation": …,
      "avatar_url": …,
      "created_at": …,
      "account_status": …,
      "platform": …
    }
  ],
  "count": …,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=twitter
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
