# X (Twitter) Details API (twitter.profile)

- Canonical page: https://everyinfra.com/en/twitter-api/profile
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "twitter", "action": "profile", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: single object
- Mode: sync; add "mode": "async" for slow tasks

X (Twitter) Details reads the public profile of one X account from its `username` and returns a single record: `user_id`, handle, display name, bio, location, profile link, avatar, follower, following and post counts, verification and the date the account was created. Marketers, journalists and analysts use it to check who is behind a handle and how large and active the account is: vetting creators before a campaign, confirming an official account before citing it, or enriching a list of handles with audience size.

`display_name` is the name shown on the profile and can differ from the handle, so match accounts on `username`, or better on `user_id`, the account's unique ID on X. The bio may include line breaks and emoji. A null `follower_count`, `following_count` or `post_count` means the number was not disclosed, and a null `is_verified` means verification could not be determined.

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| username | not declared | yes | not declared | X username, optionally prefixed with @, without entering a full profile URL. profile compiles data from author details within recent posts; followers_list and following_list retrieve visible followers and following accounts respectively. |

## 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. |
| bio | Profile bio written by the account; may contain line breaks and emoji. |
| url | Link to the record on the platform. |
| follower_count | Followers. null means not disclosed, not 0. |
| following_count | Accounts followed. null means not disclosed, not 0. |
| post_count | Total posts. null means not disclosed, not 0. |
| is_verified | Whether the platform verified the account. null means it cannot be determined. |
| location | Location description passed through as is; the format varies by platform. |
| avatar_url | Avatar image link. Some platforms return sized CDN links that can expire. |
| created_at | Creation time, same format as posted_at. |
| 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": "profile",
  "params": {
    "username": "nasa"
  }
}'
```

```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": "profile",
        "params": {
            "username": "nasa",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-09-26T08:56:04Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "twitter",
  "action": "profile",
  "results": {
    "user_id": "•••",
    "username": "NASA",
    "display_name": "NASA",
    "url": "https://x.com/NASA",
    "follower_count": 92375075,
    "following_count": 115,
    "post_count": 74334,
    "is_verified": true,
    "location": "Pale Blue Dot",
    "avatar_url": "https://pbs.twimg.com/•••",
    "created_at": "Wed Dec 19 20:20:32 +0000 2007",
    "platform": "twitter"
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### What do I pass as `username`?

The handle that follows x.com/ in the profile link, such as nasa; a leading @ is fine. Pass neither the full link nor the display name: the field takes the handle only, and `display_name` in the result is the separate name shown on the profile.

### How do I track an account's growth over time?

Call it on a schedule and store `follower_count`, `following_count` and `post_count` with the date of each call, keyed on `user_id`. Each call is one snapshot, so the series is only as fine-grained as your schedule, and a null value marks a gap rather than a drop to zero.

### How do I get the account's posts and followers?

This capability returns the profile only. Pass the same handle to X (Twitter) Posts by user for the account's posts, or to Follower list and Following list for the accounts on either side of its follow graph; all three take `username` in the same form.

## 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
