# Section

A section's text with its citation and credit.

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

`GET /api/v1/library/{lang}/{author}/{work}/{ref}`

Mirrors the section page. A citation inside a section (Aeneid 1.17) returns the section that holds it (1.1-11). Follow next.api to read on.

## Parameters

| Field | Type | Description |
|---|---|---|
| `lang` | string, in path | Required. Language as in site URLs. One of `latin`, `greek`. Example `latin`. |
| `author` | string, in path | Required. Example `virgil`. |
| `work` | string, in path | Required. Example `aeneid`. |
| `ref` | string, in path | Required. A citation in the work: 1.46, 17, 1.1.3. Example `1.1`. |
| `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/library/latin/virgil/aeneid/1.1"
```

JavaScript:

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

print(data)
```

## Example response

Response (200 OK):

```json
{
  "kind": "section",
  "lang": "la",
  "language": "Latin",
  "title": "Aeneid 1.1-45",
  "citation": "Virgil, Aeneid 1.1-45",
  "ref": "1.1",
  "level": null,
  "urn": "urn:cts:latinLit:phi0690.phi003.perseus-lat2:1.1-1.45",
  "url": "https://interlinea.aeterna-institute.org/library/latin/virgil/aeneid/1.1",
  "api": "https://interlinea.aeterna-institute.org/api/v1/library/latin/virgil/aeneid/1.1",
  "markdown": "https://interlinea.aeterna-institute.org/library/latin/virgil/aeneid/1.1.md",
  "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": 287,
  "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": null,
  "next": {
    "citation": "Aeneid 1.46-86",
    "label": "Lines 1.46-1.86",
    "url": "https://interlinea.aeterna-institute.org/library/latin/virgil/aeneid/1.46",
    "api": "https://interlinea.aeterna-institute.org/api/v1/library/latin/virgil/aeneid/1.46"
  },
  "credit": {
    "text": "Virgil, Aeneid, ed. J. B. Greenough. Text: the Perseus Digital Library, canonical-latinLit, CC BY-SA 4.0. Changes: apostrophes normalised an…",
    "license": "CC BY-SA 4.0",
    "licenseUrl": "https://creativecommons.org/licenses/by-sa/4.0/",
    "source": "https://github.com/PerseusDL/canonical-latinLit/blob/master/data/phi0690/phi003/phi0690.phi003.perseus-lat2.xml",
    "quality": "proofread"
  }
}
```

## Try it

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

---

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