# PoetryDB API

> Returns poet names and poems with full text by author, title or at random from PoetryDB.

Category: Entertainment & Books. Region: global. 6 endpoints at `https://api.hoshime.com/v1/poetrydb/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/poetrydb
## GET /v1/poetrydb/authors

The names of the poets PoetryDB holds, alphabetically.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `avatarUrl` (string), `bio` (string), `createdAt` (string), `followerCount` (integer (int64)), `followingCount` (integer (int64)), `id` (string), `name` (string), `postCount` (integer (int64)), `url` (string), `username` (string), `verified` (boolean)

```bash
curl "https://api.hoshime.com/v1/poetrydb/authors" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/poetrydb/poems

The poems of one poet, with their full text, in PoetryDB's order.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `author` | string | yes | The poet's name as PoetryDB lists it, such as William Blake. (e.g. William Blake) |
| `limit` | integer | no | Poems per page, from 1 to 100. (default 20) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `lineCount` (integer (int64)), `lines` (Line[]), `lines[].text` (string), `title` (string)

```bash
curl "https://api.hoshime.com/v1/poetrydb/poems?author=William+Blake" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/poetrydb/titles

The titles of one poet's poems, without their text, in PoetryDB's order. A short list for a poet with many poems.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `author` | string | yes | The poet's name as PoetryDB lists it, such as William Blake. (e.g. William Blake) |
| `limit` | integer | no | Poems per page, from 1 to 100. (default 20) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `title` (string)

```bash
curl "https://api.hoshime.com/v1/poetrydb/titles?author=William+Blake" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/poetrydb/title

The poems with one exact title, by any poet, with their full text.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `title` | string | yes | The exact title, such as Ozymandias. (e.g. Ozymandias) |
| `limit` | integer | no | Poems per page, from 1 to 100. (default 20) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `lineCount` (integer (int64)), `lines` (Line[]), `lines[].text` (string), `title` (string)

```bash
curl "https://api.hoshime.com/v1/poetrydb/title?title=Ozymandias" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/poetrydb/poem

The poem with one exact title by one exact author, with its full text.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `author` | string | yes | The poet's name as PoetryDB lists it, such as William Blake. (e.g. William Blake) |
| `title` | string | yes | The exact title, such as The Tyger. (e.g. The Tyger) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `lineCount` (integer (int64)), `lines` (Line[]), `lines[].text` (string), `title` (string)

```bash
curl "https://api.hoshime.com/v1/poetrydb/poem?author=William+Blake&title=The+Tyger" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/poetrydb/random

Random poems from the whole collection, 1 to 10 at a time, with their full text.

Scope: `social:read` · Units: 1 · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 10. (default 1) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `lineCount` (integer (int64)), `lines` (Line[]), `lines[].text` (string), `title` (string)

```bash
curl "https://api.hoshime.com/v1/poetrydb/random" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
