# OpenAPI document

The OpenAPI 3.1 document for version 1.

Canonical: https://interlinea.aeterna-institute.org/docs/api/openapi

`GET /api/v1/openapi.json`

The OpenAPI 3.1 description of version 1.

## Parameters

None.

## Response

`200 OK` with the OpenAPI 3.1 document, as JSON.

## Errors

| Status | When |
|---|---|
| `429 Too Many Requests` | Too many requests from one address. Wait a minute. |
| `500 Internal Server Error` | Something went wrong on our side. |

Error bodies are described in [Caching, limits and errors](https://interlinea.aeterna-institute.org/docs/limits.md#errors).

## Example request

curl:

```sh
curl "https://interlinea.aeterna-institute.org/api/v1/openapi.json"
```

JavaScript:

```js
const res = await fetch("https://interlinea.aeterna-institute.org/api/v1/openapi.json")
const data = await res.json()
console.log(data)
```

Python:

```python
import json
from urllib.request import urlopen

with urlopen("https://interlinea.aeterna-institute.org/api/v1/openapi.json") as res:
    data = json.load(res)

print(data)
```

## Example response

Response (200 OK):

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Interlinea API",
    "version": "1",
    "summary": "Read-only access to a library of Latin and Ancient Greek texts, with citations, credits and stored word analyses.",
    "description": "Free, no key, GET only, CORS open. Responses are cached for up to a day; please keep to about 120 requests a minute from one address. Every…",
    "contact": {…},
    "license": {…}
  },
  "externalDocs": {
    "description": "Developer docs",
    "url": "https://interlinea.aeterna-institute.org/docs"
  },
  "servers": [
    {…}
  ],
  "paths": {
    "/api/v1": {…},
    "/api/v1/openapi.json": {…},
    "/api/v1/search": {…},
    "/api/v1/library/{lang}/{author}": {…},
    "/api/v1/library/{lang}/{author}/{work}": {…},
    "/api/v1/library/{lang}/{author}/{work}/{ref}": {…},
    "/api/v1/passages": {…},
    "/api/v1/passages/{lang}/{slug}": {…},
    "/api/v1/text": {…},
    "/api/v1/analysis": {…},
    "/api/v1/context": {…},
    "/api/v1/words": {…}
  },
  "components": {
    "schemas": {…}
  }
}
```

## Try it

Send a real GET from your browser and see the answer, its status and how long it took.

---

Previous: [API index](https://interlinea.aeterna-institute.org/docs/api/index.md)
Next: [Citations and CTS URNs](https://interlinea.aeterna-institute.org/docs/citations.md)
