# Stats API

The Stats API: hematite's public counts as JSON, and as badges for a README, with every endpoint's fields, who may call it, its rate limit and a curl example.

## Get hematite's public counts: accounts, images, uploads and views of the last 7 days, storage and custom domains. Counted every 15 minutes, never per request, each rounded down to two significant digits, so every number holds as a floor. Before the first count, every number and `countedAt` are null. Each is also a badge for a README, the same value as an SVG in shields.io's flat style: `/stats/users.svg`, `images.svg`, `uploads.svg`, `storage.svg`, `views.svg` and `domains.svg`, kept 15 minutes (`Cache-Control: public, max-age=900`) with an ETag.

`GET /stats`

Needs no token. Rate limit: 120 a minute, per address. Any app's token may call it.

### Response

Returns an `object` with these fields:

| Field | Type | Present | Notes |
|---|---|---|---|
| `users` | `integer \| null` |  | Accounts with a confirmed email. Rounded down to two significant digits (1,250 is 1,200), as its badge shows it; null before the first count. |
| `images` | `integer \| null` |  | Images hosted, private ones included; deleted ones aren't. Rounded down to two significant digits (1,250 is 1,200), as its badge shows it; null before the first count. |
| `uploads7d` | `integer \| null` |  | Of those, the ones uploaded in the 7 days before `countedAt`. Rounded down to two significant digits (1,250 is 1,200), as its badge shows it; null before the first count. |
| `storage` | `integer \| null` |  | The images' bytes, as a plan's storage limit counts them. Rounded down to two significant digits (1,250 is 1,200), as its badge shows it; null before the first count. |
| `views7d` | `integer \| null` |  | Views of images and folders in the 7 days before `countedAt`, each address once per item and week. Rounded down to two significant digits (1,250 is 1,200), as its badge shows it; null before the first count. |
| `domains` | `integer \| null` |  | Custom domains connected and working, hematite's own left out. Rounded down to two significant digits (1,250 is 1,200), as its badge shows it; null before the first count. |
| `countedAt` | `date-time \| null` |  | When they were counted; null before the first count. |

```bash
curl 'https://api.hematite.gg/v1/stats'
```

Example `data`:

```json
{
  "users": 0,
  "images": 0,
  "uploads7d": 0,
  "storage": 0,
  "views7d": 0,
  "domains": 0,
  "countedAt": "2026-11-10T18:24:00.000Z"
}
```
