# OpenAPI and schema files

> Download the machine-readable API description and JSON Schemas.

Page: https://docs.aggre.org/api/openapi · Section: API reference · All pages: https://docs.aggre.org/llms.txt

Everything in the [reference](https://docs.aggre.org/api/data.md) is generated from files you can download and feed to a client generator, a validator or an agent.

## OpenAPI {#openapi}

| File | Describes | Formats |
|---|---|---|
| Data API | Every read route of `https://api.aggre.org` | [`/openapi/data.yaml`](https://docs.aggre.org/openapi/data.yaml), [`/openapi/data.json`](https://docs.aggre.org/openapi/data.json) |
| Accounts API | The console's control-plane routes (platform-staff routes left out) | [`/openapi/accounts.yaml`](https://docs.aggre.org/openapi/accounts.yaml), [`/openapi/accounts.json`](https://docs.aggre.org/openapi/accounts.json) |

Both are OpenAPI 3. In the data API file, row schemas are `$ref`s to the JSON Schema files below, as absolute URLs on this site, so a tool resolves them without extra configuration. The files are served with `Access-Control-Allow-Origin: *`.

The data API file is kept equal to the service's own router by a contract test: every registered route is in the spec and every operation in the spec is registered, and the query parameters match what each route's parser accepts.

## JSON Schemas {#schemas}

One file per row type at `/schemas/{name}.json`, for example [`/schemas/candles.json`](https://docs.aggre.org/schemas/candles.json). They are JSON Schema draft 2020-12. The [schema reference](https://docs.aggre.org/api/schemas.md) lists the fields of each and the file names. The `$id` inside a schema is the schema's canonical identifier and may name `aggre.org`; the copy served here is the same file.

## Using them {#using}

```bash
# validate a row against its schema
curl -s https://docs.aggre.org/schemas/candles.json -o candles.schema.json

# generate a typed client (any OpenAPI 3 generator works)
curl -s https://docs.aggre.org/openapi/data.yaml -o aggre-data.openapi.yaml
```

Ignore properties a schema does not list: fields are added over time ([Versioning](https://docs.aggre.org/reference/versioning.md)).
