# Author

An author and their works.

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

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

Mirrors the author page /library/{lang}/{author}.

## 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. Author slug, as in the site URL. Example `virgil`. |

## Response

`200 OK` with a `Author` object.

| Field | Type | Description |
|---|---|---|
| `name` | string |  |
| `nativeName` | string or null |  |
| `lang` | string | Language code: la (Latin) or grc (Ancient Greek). One of `la`, `grc`. |
| `period` | string or null |  |
| `url` | string | Absolute URL. |
| `api` | string | Absolute URL. |
| `language` | string |  |
| `markdown` | string | Absolute URL. |
| `works` | array of WorkSummary |  |
| `works[].title` | string |  |
| `works[].nativeTitle` | string or null | The title in Latin or Greek, when it differs. |
| `works[].author` | string |  |
| `works[].lang` | string | Language code: la (Latin) or grc (Ancient Greek). One of `la`, `grc`. |
| `works[].genre` | string or null |  |
| `works[].words` | integer |  |
| `works[].sections` | integer | Reading sections. |
| `works[].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). |
| `works[].url` | string | Absolute URL. |
| `works[].api` | string | Absolute URL. |

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

JavaScript:

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

print(data)
```

## Example response

Response (200 OK):

```json
{
  "name": "Virgil",
  "nativeName": null,
  "lang": "la",
  "period": "late-republic-augustan",
  "url": "https://interlinea.aeterna-institute.org/library/latin/virgil",
  "api": "https://interlinea.aeterna-institute.org/api/v1/library/latin/virgil",
  "language": "Latin",
  "markdown": "https://interlinea.aeterna-institute.org/library/latin/virgil.md",
  "works": [
    {
      "title": "Aeneid",
      "nativeTitle": "Aeneis",
      "author": "Virgil",
      "lang": "la",
      "genre": "epic",
      "words": 63347,
      "sections": 223,
      "urn": "urn:cts:latinLit:phi0690.phi003",
      "url": "https://interlinea.aeterna-institute.org/library/latin/virgil/aeneid",
      "api": "https://interlinea.aeterna-institute.org/api/v1/library/latin/virgil/aeneid"
    },
    {
      "title": "Eclogues",
      "nativeTitle": "Eclogae",
      "author": "Virgil",
      "lang": "la",
      "genre": "epic",
      "words": 5615,
      "sections": 21,
      "urn": "urn:cts:latinLit:phi0690.phi001",
      "url": "https://interlinea.aeterna-institute.org/library/latin/virgil/eclogues",
      "api": "https://interlinea.aeterna-institute.org/api/v1/library/latin/virgil/eclogues"
    },
    {
      "title": "Georgicon",
      "nativeTitle": null,
      "author": "Virgil",
      "lang": "la",
      "genre": "epic",
      "words": 14177,
      "sections": 51,
      "urn": null,
      "url": "https://interlinea.aeterna-institute.org/library/latin/virgil/georgicon",
      "api": "https://interlinea.aeterna-institute.org/api/v1/library/latin/virgil/georgicon"
    },
    // 1 more
  ]
}
```

## Try it

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

---

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