# Key and usage

Source: https://www.scanner.net/docs/api/reference/account

> Check which account and key a request authenticated as, and read your remaining scans and daily request counts.

Two routes report on the key itself. They work whatever endpoint groups the key is limited to. Neither spends scans, but both count toward the rate limit.

2 routes. Every path below is served under `https://api.scanner.net`, and every request carries the key header, so those two are not repeated per route. Shared errors and limits are in [Requests and errors](/docs/api/reference/conventions).

Who am I [#who-am-i]

```http
GET /v1/whoami
```

The account and key the request authenticated as. Use it to check a key works. No parameters.

```bash
curl "https://api.scanner.net/v1/whoami" \
  -H "x-api-key: $SCANNER_API_KEY"
```

**Response:**

```json
{
  "success": true,
  "user": { "id": "...", "email": "ab***@example.com" },
  "authentication": { "method": "api_key", "key": { "id": "...", "name": "production" } },
  "plan": { "type": "scale", "rpm": 120 }
}
```

`plan.type` is `scale` or `enterprise`. `email` is masked, and `null` when the account has none. `plan.rpm` is the per-minute limit for this key, after any lower limit you set on it.

Usage [#usage]

```http
GET /v1/usage
```

Remaining scans, the key's limit, and daily request counts for the whole account (every key, plus the browser extension).

| Parameter | In    | Type    | Required | Notes                |
| --------- | ----- | ------- | -------- | -------------------- |
| `days`    | query | integer | no       | 1 to 90. Default 30. |

```bash
curl "https://api.scanner.net/v1/usage?days=7" \
  -H "Authorization: Bearer $SCANNER_API_KEY"
```

**Response:** `{ "success": true, "credits", "limit": { "rpm" }, "daily": [...] }`.

* `credits`: scans left on the account.
* `daily`: one row per day, client, endpoint group and status class, with `date` (`YYYY-MM-DD`), `clientType` (`api`, `extension` or `indexer`), `endpointGroup` (a path such as `/explorer/address/:address`), `statusClass` (`2xx`, `4xx`, `429` and so on), `origin` and `requests`.

Usage can take up to a minute to appear.
