# Twitter Score of a single account

`GET https://twitterscore.io/api/v1/get_twitter_score`

Resolves one X/Twitter account by `username` or `twitter_id` and returns its current Twitter Score (0–1000). Resolution order: by `twitter_id` in the curated accounts table (Account), then in the follower-graph table (Friend); by `username` as an exact match on Account.username, then Account.slug, then Friend.username, then Friend.slug, then a previous-username fallback for handles that were renamed away — so a request for an old handle returns the account's CURRENT `username` and `twitter_id`. If the resolved row has no score but a scored twin row with the same twitter_id exists, the twin's score is reported. When both parameters are sent, `twitter_id` is tried first and `username` is used only if the id resolves nothing.

**Required:** one of `username`, `twitter_id`.

## Parameters

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `username` | string | no |  | X/Twitter handle without the leading @ (surrounding whitespace and slashes are stripped; an '@' prefix is NOT stripped). Exact match on the stored handle (case-insensitive only insofar as the MySQL column collation is case-insensitive); also matches the TwitterScore profile slug and previous handles of renamed accounts. |
| `twitter_id` | integer | no |  | Numeric X/Twitter user id. Tried before `username` when both are given. |

At least one of `username`, `twitter_id` is required.

## Example request

```bash
curl -s "https://twitterscore.io/api/v1/get_twitter_score?username=VitalikButerin" \
  -H "X-API-Key: $TWITTERSCORE_API_KEY" \
  -H "User-Agent: my-app/1.0 (contact@example.com)"
```

```python
import os, requests

r = requests.get(
    "https://twitterscore.io/api/v1/get_twitter_score",
    params={"username": "VitalikButerin"},
    headers={"X-API-Key": os.environ["TWITTERSCORE_API_KEY"],
             "User-Agent": "my-app/1.0 (contact@example.com)"},
    timeout=15,
)
data = r.json()
if not data.get("success", True):      # errors arrive as success=false (see /developers/errors/)
    raise RuntimeError(data["message"])
print(data)
```

```javascript
const r = await fetch("https://twitterscore.io/api/v1/get_twitter_score?username=VitalikButerin", {
  headers: { "X-API-Key": process.env.TWITTERSCORE_API_KEY,
             "User-Agent": "my-app/1.0 (contact@example.com)" },
});
const data = await r.json();
if (data.success === false) throw new Error(data.message);
console.log(data);
```

## Example response

```json
{
  "success": true,
  "username": "VitalikButerin",
  "twitter_id": "295218901",
  "twitter_score": 1000.0
}
```

## Errors

Error codes this endpoint can return (see [Errors](/developers/errors/) for the body format): `api_key_missing`, `api_key_invalid`, `api_access_deactivated`, `api_key_revoked`, `invalid_params`, `account_not_found`, `method_not_allowed`, `rate_limited`, `quota_exceeded`, `server_error`.

---

Authentication: `X-API-Key` header (or `Authorization: Bearer`), see [Authentication](/developers/authentication/). Limits: per-minute rate and monthly quota by plan, see [Rate limits](/developers/rate-limits/). Machine-readable definition: [/openapi.json](/openapi.json).