GET /api/v1/characters
searchCharacters
needs catalog:read
A resource of its own rather than a kind inside one `/search`. The site has a single search window because a person typing wants one box, and it answers an object of six collections — a shape built for that window. An application looking for a character wants characters, paged, and asking it to unwrap five lists it did not want is the `?include=` this api does not have, backwards.
curl https://api.acyka.cc/api/v1/characters?q=frieren&lang=en \
-H "Authorization: Bearer $ACYKA_TOKEN" Asking #
Narrowing it
| field | type | what it is |
|---|---|---|
q may be absent | string | undefined | what to search for |
lang may be absent | string | undefined | which of a title's three names leads: `en` (romaji), `ru`, `ja`, `uk`, `uz`. Defaults to `en`. |
limit may be absent | number | undefined | how many rows, 1-100; 30 by default |
Answering #
200 Page<CharacterCard> a page: items, and total beside it
The shapes #
CharacterCard #
| field | type | what it is |
|---|---|---|
id | number | |
name | string | |
name_orig may be absent | string | undefined | |
poster may be absent | string | undefined |
When it says no #
A refusal is { "message": "errors.something" } — a phrase name and never a
sentence, because one screen can be read in five languages. Every library turns the name into a
type, so you catch the class you can do something about. Errors has
the list.