# Words

Look a word up in the stored analyses.

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

`GET /api/v1/words`

A headword's spellings and meanings in context, and cited sentences where it occurs. Accents, breathings and macrons are ignored: fio finds fīō.

## Parameters

| Field | Type | Description |
|---|---|---|
| `lemma` | string, in query | Required. Dictionary form: amo, arma, λόγος. Up to 60 characters. Example `arma`. |
| `lang` | string, in query | Optional. Defaults to Greek for Greek letters, otherwise Latin. One of `la`, `grc`, `latin`, `greek`. |
| `limit` | integer, in query | Optional. Occurrences, at most 50. Default `10`. From 1 to 50. |

## Response

`200 OK` with a `WordLookup` object.

| Field | Type | Description |
|---|---|---|
| `lemma` | string | The headword asked for. |
| `lang` | string | Language code: la (Latin) or grc (Ancient Greek). One of `la`, `grc`. |
| `entries` | array of object | Each headword spelling found, with the meanings it had in context. |
| `entries[].lemma` | string |  |
| `entries[].entry` | string or null |  |
| `entries[].upos` | string |  |
| `entries[].glosses` | array of string |  |
| `entries[].count` | integer |  |
| `occurrences` | array of object |  |
| `occurrences[].form` | string |  |
| `occurrences[].lemma` | string |  |
| `occurrences[].upos` | string |  |
| `occurrences[].feats` | string |  |
| `occurrences[].gloss` | string |  |
| `occurrences[].sentence` | string |  |
| `occurrences[].translation` | string |  |
| `occurrences[].citation` | string |  |
| `occurrences[].url` | string | Absolute URL. |
| `occurrences[].api` | string | Absolute URL. |
| `occurrences[].license` | string |  |
| `credits` | array of string | Credit lines for the editions quoted above. |
| `note` | string |  |

## Errors

| Status | When |
|---|---|
| `400 Bad Request` | A parameter is missing or invalid, or the reference isn't a text. |
| `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/words?lemma=arma"
```

JavaScript:

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

print(data)
```

## Example response

Response (200 OK):

```json
{
  "lemma": "arma",
  "lang": "la",
  "entries": [
    {
      "lemma": "arma",
      "entry": "arma, armōrum n. pl.",
      "upos": "NOUN",
      "glosses": [
        "arms",
        "the arms"
      ],
      "count": 2
    }
  ],
  "occurrences": [
    {
      "form": "Arma",
      "lemma": "arma",
      "upos": "NOUN",
      "feats": "Case=Acc|Gender=Neut|Number=Plur",
      "gloss": "arms",
      "sentence": "Arma virumque cano, Troiae qui primus ab oris\nItaliam, fato profugus, Laviniaque venit\nlitora, multum ille et terris iactatus et alto\nvi sup…",
      "translation": "I sing of arms and a man, who first, an exile by fate, came from the shores of Troy to Italy and the Lavinian shores, that man having been t…",
      "citation": "Virgil, Aeneid 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",
      "license": "CC BY-SA 4.0"
    },
    {
      "form": "arma",
      "lemma": "arma",
      "upos": "NOUN",
      "feats": "Case=Nom|Gender=Neut|Number=Plur",
      "gloss": "the arms",
      "sentence": "et Pompei Crassique potentia cito in Caesarem, Lepidi atque Antonii arma in Augustum cessere, qui cuncta discordiis civilibus fessa nomine p…",
      "translation": "And the power of Pompey and Crassus quickly passed to Caesar, and the arms of Lepidus and Antony passed to Augustus, who received all things…",
      "citation": "Tacitus, Annales 1.1",
      "url": "https://interlinea.aeterna-institute.org/read/latin/tacitus-annals",
      "api": "https://interlinea.aeterna-institute.org/api/v1/passages/latin/tacitus-annals",
      "license": "CC BY-SA 4.0"
    }
  ],
  "credits": [
    "Virgil, Aeneid 1.1–11. CC BY-SA 4.0. Perseus Digital Library (Tufts University), PerseusDL/canonical-latinLit; edition: J. B. Greenough, Gin…",
    "Tacitus, Annales 1.1. CC BY-SA 4.0. Perseus Digital Library (Tufts University), PerseusDL/canonical-latinLit; edition: C. D. Fisher, Oxford…"
  ],
  "note": "From stored analyses only: the graded passages and the library sections readers have opened. Accents, breathings and macrons are ignored whe…"
}
```

## Try it

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

---

Previous: [Context](https://interlinea.aeterna-institute.org/docs/api/context.md)
Next: [Search](https://interlinea.aeterna-institute.org/docs/api/search.md)
