# HP API API

> Returns Harry Potter characters, spells, Hogwarts houses and books, including a random character with its film actor.

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

Characters of the books and films, optionally of one Hogwarts house.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `house` | string | no | Only characters of this house. (one of gryffindor, slytherin, ravenclaw, hufflepuff) |
| `limit` | integer | no | Items per page, 1 to 100. (default 10) |
| `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: `actor` (string), `alive` (boolean), `ancestry` (string), `dateOfBirth` (string), `gender` (string), `hogwartsStaff` (boolean), `hogwartsStudent` (boolean), `house` (string), `id` (string), `image` (string), `name` (string), `patronus` (string), `species` (string), `wand` (Wand), `wand.core` (string), `wand.length` (number (double)), `wand.wood` (string), `wizard` (boolean), `yearOfBirth` (integer (int64))

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

## GET /v1/hpapi/character

One character by its HP API id.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Character id, a UUID such as 9e3f7ce4-b9a7-4244-b709-dae5c1f1d4a8. (e.g. 9e3f7ce4-b9a7-4244-b709-dae5c1f1d4a8) |
| `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: `actor` (string), `alive` (boolean), `ancestry` (string), `dateOfBirth` (string), `gender` (string), `hogwartsStaff` (boolean), `hogwartsStudent` (boolean), `house` (string), `id` (string), `image` (string), `name` (string), `patronus` (string), `species` (string), `wand` (Wand), `wand.core` (string), `wand.length` (number (double)), `wand.wood` (string), `wizard` (boolean), `yearOfBirth` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/hpapi/character?id=9e3f7ce4-b9a7-4244-b709-dae5c1f1d4a8" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/hpapi/spells

Spells of the books with their descriptions.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `limit` | integer | no | Items per page, 1 to 100. (default 10) |
| `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: `description` (string), `id` (string), `name` (string)

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

## GET /v1/hpapi/houses

The four Hogwarts houses with their founder, colours and animal.

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: `animal` (string), `colors` (string[]), `emoji` (string), `founder` (string), `name` (string)

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

## GET /v1/hpapi/books

The seven Harry Potter novels with their release dates and page counts.

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: `cover` (string), `number` (integer (int64)), `originalTitle` (string), `pages` (integer (int64)), `releaseDate` (string), `title` (string)

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

## GET /v1/hpapi/randomCharacter

A random character of the catalogue, with the actor who played the film role.

Scope: `social:read` · Units: 1

| 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: `birthdate` (string), `children` (string[]), `fullName` (string), `house` (string), `image` (string), `index` (integer (int64)), `interpretedBy` (string), `nickname` (string)

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

## GET /v1/hpapi/roster

The characters of the catalogue, about twenty-five of them, in one list.

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: `birthdate` (string), `children` (string[]), `fullName` (string), `house` (string), `image` (string), `index` (integer (int64)), `interpretedBy` (string), `nickname` (string)

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

## GET /v1/hpapi/randomSpell

A random spell of the catalogue with what it does.

Scope: `social:read` · Units: 1

| 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: `index` (integer (int64)), `spell` (string), `use` (string)

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