# Passage

A graded passage's text.

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

`GET /api/v1/passages/{lang}/{slug}`

Mirrors /read/{lang}/{slug}. Every sentence has a stored analysis.

## Parameters

| Field | Type | Description |
|---|---|---|
| `lang` | string, in path | Required. Language as in site URLs. One of `latin`, `greek`. Example `latin`. |
| `slug` | string, in path | Required. Example `virgil-aeneid`. |
| `include` | string, in query | Optional. Extra fields, comma-separated: analysis (stored word-by-word analysis), context (stored notes). |

## Response

`200 OK` with a `Text` object.

| Field | Type | Description |
|---|---|---|
| `kind` | string | section: a reading section of a library work. passage: a graded passage. One of `section`, `passage`. |
| `lang` | string | Language code: la (Latin) or grc (Ancient Greek). One of `la`, `grc`. |
| `language` | string |  |
| `title` | string | "Aeneid 1.1-11" for a section; the passage title for a graded passage. |
| `citation` | string | "Virgil, Aeneid 1.1-11": quote this when you cite the text. |
| `ref` | string or null | The section's first citation, as used in its URL. Null for a graded passage. |
| `level` | integer or null | Graded passages: difficulty 1 to 5. |
| `urn` | string or null | CTS URN, e.g. urn:cts:latinLit:phi0690.phi003.perseus-lat2:1.1-1.11. Null when the edition has none (The Latin Library's own numbering). |
| `url` | string | Canonical page. |
| `api` | string | Absolute URL. |
| `markdown` | string or null | The same text as Markdown. |
| `author` | object |  |
| `author.name` | string |  |
| `author.url` | string or null | Absolute URL. |
| `work` | object |  |
| `work.title` | string |  |
| `work.url` | string or null | Absolute URL. |
| `work.urn` | string or null | CTS URN, e.g. urn:cts:latinLit:phi0690.phi003.perseus-lat2:1.1-1.11. Null when the edition has none (The Latin Library's own numbering). |
| `verse` | boolean |  |
| `words` | integer |  |
| `text` | string | Plain text; verse keeps its line breaks. |
| `prev` | Link or null |  |
| `prev.citation` | string | "Aeneid 1.12-33" |
| `prev.label` | string | "Book 1, lines 12-33" |
| `prev.url` | string | Absolute URL. |
| `prev.api` | string | The same resource as JSON. |
| `next` | Link or null | Follow next.api to read on without searching again. |
| `next.citation` | string | "Aeneid 1.12-33" |
| `next.label` | string | "Book 1, lines 12-33" |
| `next.url` | string | Absolute URL. |
| `next.api` | string | The same resource as JSON. |
| `credit` | Credit |  |
| `credit.text` | string | Credit line for the edition: author, work, editor, source, licence and changes. Quote it when you reuse the text. |
| `credit.license` | string | CC BY-SA 4.0, CC BY 3.0, Used with permission (The Latin Library), or a public-domain note. |
| `credit.licenseUrl` | string or null |  |
| `credit.source` | string | Where the edition comes from. |
| `credit.quality` | string | ocr: an unproofread scan. One of `proofread`, `ocr`. |
| `analysis` | Analysis | Optional. Only with include=analysis. |
| `analysis.analysed` | integer | Sentences with a stored analysis. |
| `analysis.total` | integer | Sentences in the text. |
| `analysis.license` | string | The analyses adapt CC BY-SA text, so they are share-alike. Always `CC BY-SA 4.0`. |
| `analysis.note` | string |  |
| `analysis.sentences` | array of AnalysedSentence |  |
| `analysis.sentences[].index` | integer | 0-based sentence index in the text. |
| `analysis.sentences[].text` | string |  |
| `analysis.sentences[].translation` | string or null | Null when the sentence has no stored analysis yet. |
| `analysis.sentences[].words` | array of Word or null | Null when the sentence has no stored analysis yet. |
| `analysis.sentences[].words[].i` | integer | 1-based index of the word in its sentence. |
| `analysis.sentences[].words[].form` | string | The word as printed. |
| `analysis.sentences[].words[].lemma` | string | Dictionary headword; Latin with macrons, Greek polytonic. |
| `analysis.sentences[].words[].entry` | string or null | Dictionary entry: principal parts, or genitive and gender. |
| `analysis.sentences[].words[].upos` | string | Universal Dependencies part of speech. |
| `analysis.sentences[].words[].feats` | string | Universal Dependencies features, e.g. "Case=Acc\|Gender=Neut\|Number=Plur"; "_" if none. |
| `analysis.sentences[].words[].head` | integer | Index of the word this one depends on; 0 for the root. |
| `analysis.sentences[].words[].deprel` | string | Universal Dependencies relation to its head: nsubj, obj, amod, … |
| `analysis.sentences[].words[].gloss` | string | Meaning in this sentence, 1 to 4 words. |
| `analysis.sentences[].words[].note` | string or null | One sentence on the word's role. |
| `analysis.sentences[].words[].enclitic` | object | Optional. Present only when an enclitic rides on the word, e.g. -que "and". |
| `analysis.sentences[].words[].enclitic.form` | string |  |
| `analysis.sentences[].words[].enclitic.gloss` | string |  |
| `context` | Context | Optional. Only with include=context. |
| `context.machineWritten` | boolean | False for the graded passages' hand-written notes. |
| `context.section` | object or null | Null until someone has opened Context for this part in the reader. |
| `context.section.soFar` | string or null | What has happened in the work before this part. |
| `context.section.here` | string or null | What happens in this part, never a translation. |
| `context.section.people` | array of object | People, gods and places named here. |
| `context.section.people[].name` | string |  |
| `context.section.people[].note` | string |  |
| `context.section.people[].forms` | array of string | The words in the text that name them. |
| `context.section.people[].wikipedia` | string or null | English Wikipedia article title, when certain. |
| `context.section.next` | string or null | What comes next. |
| `context.work` | object or null | A few lines about the work. |
| `context.work.intro` | string or null |  |
| `context.work.note` | string or null |  |

## Errors

| Status | When |
|---|---|
| `400 Bad Request` | A parameter is missing or invalid, or the reference isn't a text. |
| `404 Not Found` | Not in the library. |
| `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/passages/latin/virgil-aeneid"
```

JavaScript:

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

print(data)
```

## Example response

Response (200 OK):

```json
{
  "kind": "passage",
  "lang": "la",
  "language": "Latin",
  "title": "Arms and the Man",
  "citation": "Virgil, Aeneid 1.1–11",
  "ref": null,
  "level": 4,
  "urn": "urn:cts:latinLit:phi0690.phi003.perseus-lat2:1.1-1.11",
  "url": "https://interlinea.aeterna-institute.org/read/latin/virgil-aeneid",
  "api": "https://interlinea.aeterna-institute.org/api/v1/passages/latin/virgil-aeneid",
  "markdown": null,
  "author": {
    "name": "Virgil",
    "url": "https://interlinea.aeterna-institute.org/library/latin/virgil"
  },
  "work": {
    "title": "Aeneid",
    "url": "https://interlinea.aeterna-institute.org/library/latin/virgil/aeneid",
    "urn": "urn:cts:latinLit:phi0690.phi003"
  },
  "verse": true,
  "words": 73,
  "text": "Arma virumque cano, Troiae qui primus ab oris\nItaliam, fato profugus, Laviniaque venit\nlitora, multum ille et terris iactatus et alto\nvi sup…",
  "prev": {
    "citation": "Metamorphoses 1.1–9",
    "label": "Bodies Changed",
    "url": "https://interlinea.aeterna-institute.org/read/latin/ovid-metamorphoses",
    "api": "https://interlinea.aeterna-institute.org/api/v1/passages/latin/ovid-metamorphoses"
  },
  "next": {
    "citation": "Odes 1.11",
    "label": "Seize the Day",
    "url": "https://interlinea.aeterna-institute.org/read/latin/horace-carpe-diem",
    "api": "https://interlinea.aeterna-institute.org/api/v1/passages/latin/horace-carpe-diem"
  },
  "credit": {
    "text": "Virgil, Aeneid 1.1–11. CC BY-SA 4.0. Perseus Digital Library (Tufts University), PerseusDL/canonical-latinLit; edition: J. B. Greenough, Gin…",
    "license": "CC BY-SA 4.0",
    "licenseUrl": "https://creativecommons.org/licenses/by-sa/4.0/",
    "source": "https://scaife.perseus.org/reader/urn:cts:latinLit:phi0690.phi003.perseus-lat2:1.1-1.11/",
    "quality": "proofread"
  }
}
```

## Try it

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

---

Previous: [Passages](https://interlinea.aeterna-institute.org/docs/api/passages.md)
Next: [API index](https://interlinea.aeterna-institute.org/docs/api/index.md)
