# Account analytics overview

`POST https://api.twittrapi.com/premium/analyticsOverview`

The account analytics overview of your X account (needs X Premium).

HTML page: https://www.twittrapi.com/docs/account-actions/premium-analyticsoverview

> Account actions run with the session cookie of your own X account and go out through your own proxy. Use only accounts you control and follow X's rules; automated posting, following or liking can get the account limited or suspended. Treat the cookie like a password. Trial keys cannot call these endpoints.

## Parameters

| Name | In | Type | Required | Default | Description |
| --- | --- | --- | --- | --- | --- |
| `cookie` | body | string | yes |  | Cookie header of your own logged-in X session. Must contain auth_token and ct0; guest_id is used when present. |
| `proxy` | body | string | yes |  | Your proxy, format http://user:pass@host:port. The requests to X go out through it. Used only for this request. |

Body parameters are sent as a JSON object with `Content-Type: application/json`.

## Response

X's AccountOverviewQuery response, passed through with X's status code and content type. Not wrapped in {status_code, response}.

## Errors

| Status | When |
| --- | --- |
| 400 | cookie is missing, the body is not valid JSON, the cookie has no ct0, or the proxy URL is invalid. |
| 422 | proxy is missing. |
| 502 | The request to X failed (for example through the proxy). Refunded. |
| X's status | Any status X answers with: passed through. |

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, 408, 409 or a 5xx error are refunded.

## Example request

curl:

```bash
curl -X POST 'https://api.twittrapi.com/premium/analyticsOverview' \
  --header 'X-API-KEY: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"cookie":"auth_token=...; ct0=...","proxy":"http://user:pass@host:port"}'
```

Python:

```python
import httpx

resp = httpx.post(
    "https://api.twittrapi.com/premium/analyticsOverview",
    headers={"X-API-KEY": "YOUR_API_KEY"},
    json={
        "cookie": "auth_token=...; ct0=...",
        "proxy": "http://user:pass@host:port",
    },
    timeout=60,
)
print(resp.status_code, resp.json())
```

Node.js:

```js
const resp = await fetch("https://api.twittrapi.com/premium/analyticsOverview", {
  method: "POST",
  headers: { "X-API-KEY": process.env.TWITTRAPI_API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({
    cookie: "auth_token=...; ct0=...",
    proxy: "http://user:pass@host:port",
  }),
});
console.log(resp.status, await resp.json());
```
