# API index

What the API offers.

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

`GET /api/v1`

Links to every endpoint, the OpenAPI document, the MCP server and the docs.

## Parameters

None.

## Response

`200 OK` with a `ApiIndex` object.

| Field | Type | Description |
|---|---|---|
| `name` | string |  |
| `version` | string |  |
| `docs` | string | How to use the API, the MCP server and the Markdown pages, and how to credit texts. |
| `openapi` | string | Absolute URL. |
| `mcp` | string | MCP server, Streamable HTTP, no auth. |
| `endpoints` | object | Each endpoint and what it returns. |

## 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"
```

JavaScript:

```js
const res = await fetch("https://interlinea.aeterna-institute.org/api/v1")
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") as res:
    data = json.load(res)

print(data)
```

## Example response

Response (200 OK):

```json
{
  "name": "Interlinea",
  "version": "1",
  "docs": "https://interlinea.aeterna-institute.org/docs",
  "openapi": "https://interlinea.aeterna-institute.org/api/v1/openapi.json",
  "mcp": "https://interlinea.aeterna-institute.org/mcp",
  "endpoints": {
    "https://interlinea.aeterna-institute.org/api/v1": "What the API offers",
    "https://interlinea.aeterna-institute.org/api/v1/openapi.json": "This document",
    "https://interlinea.aeterna-institute.org/api/v1/search": "Search authors, works and topics",
    "https://interlinea.aeterna-institute.org/api/v1/library/{lang}/{author}": "An author and their works",
    "https://interlinea.aeterna-institute.org/api/v1/library/{lang}/{author}/{work}": "A work, its editions and its contents",
    "https://interlinea.aeterna-institute.org/api/v1/library/{lang}/{author}/{work}/{ref}": "A section's text with its citation and credit",
    "https://interlinea.aeterna-institute.org/api/v1/passages": "The graded path",
    "https://interlinea.aeterna-institute.org/api/v1/passages/{lang}/{slug}": "A graded passage's text",
    "https://interlinea.aeterna-institute.org/api/v1/text": "Any text, by URL, CTS URN or citation",
    "https://interlinea.aeterna-institute.org/api/v1/analysis": "The stored word-by-word analysis",
    "https://interlinea.aeterna-institute.org/api/v1/context": "The stored context notes",
    "https://interlinea.aeterna-institute.org/api/v1/words": "Look a word up in the stored analyses"
  }
}
```

## Try it

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

---

Previous: [Passage](https://interlinea.aeterna-institute.org/docs/api/passage.md)
Next: [OpenAPI document](https://interlinea.aeterna-institute.org/docs/api/openapi.md)
