animedex waifu
Waifu.im is a tagged anime art collection hosted at
https://api.waifu.im. It returns a single image (or paginated
list) along with rich tag / artist / dimension metadata. animedex
covers 9 anonymous endpoints plus 1 authenticated read endpoint
as 10 high-level Python functions.
References
Site |
|
API documentation |
|
Python module |
|
Rich models |
Backend: Waifu.im (api.waifu.im).
Rate limit: not formally published; transport applies a 10 req/sec ceiling.
Auth: optional. The
/users/meendpoint needs anX-Api-Keyheader (note: n ot Bearer). Get a personal API key from https://www.waifu.im/d ashboard after signing in with Discord.
NSFW posture
Waifu.im serves both SFW and NSFW images. The /images endpoint
defaults to SFW only when the isNsfw query parameter is omitted;
animedex mirrors this:
--is-nsfwis not passed by default. The upstream applies its SFW-only default.Pass
--is-nsfw trueto return NSFW only.Pass
--is-nsfw falseto be explicit about SFW only.Each result row carries
.isNsfwso downstream pipelines can re-filter.
The flag is a transparent passthrough — animedex never gates or warns. See the project README’s “Human Agency Principle” section.
Five endpoints, in detail
Tag by slug — tag_by_slug()
animedex waifu tag-by-slug wai fu --jq '.description'
Image search (SFW default) — images()
animedex waifu images --includ ed-tags waifu --page-size 3 \
--jq '.[] | {id, url, isNsfw }'
Image search (NSFW opt-in) — images()
animedex waifu images --is-nsf w true --page-size 3 --jq '.[].url'
Catalogue stats — stats_public()
animedex waifu stats-public -- jq '{totalImages, totalTags, totalArtists}'
# => {"totalImages": 4287, "to talTags": 19, "totalArtists": 568}
Authenticated endpoints
The /users/me endpoint needs an X-Api-Key header. Provide
via:
# Per-call (CLI):
animedex waifu me --token "<yo ur-api-key>"
# Per-shell (env var):
export ANIMEDEX_WAIFU_TOKEN="< your-api-key>"
animedex waifu me
Authenticated walkthrough
Current user — me()
animedex waifu me --jq '{name, role, requestCount}'
Endpoint summary
Command |
Python entry point |
Returns |
|---|---|---|
|
|
|
|
||
|
||
|
|
|
|
||
|
||
|
|
|
|
||
|
||
|
Pagination
Waifu.im paginates with ?pageNumber=N&pageSize=M. The high-level
helpers expose page_number / page_size kwargs:
animedex waifu artists --page- size 5
animedex waifu artists --page- size 5 --page-number 2
Gotchas
The auth header is ``X-Api-Key``, not Bearer: the upstream rejects
Authorization: Bearer ...for personal API keys. The high-level helper sets the righ t header automatically; the raw passthrough atanimedex api w aifurequires the caller to set the header themselves.Cloudflare bot heuristics are dynamic: high-volume probing from a single IP can trigger a 403 HTML “Access Denied” page. If you see the upstream returning HTML rather than JSON, throttle and back off.
The ``/fav/`` endpoint is GET-form write: bookmarking an image is exposed as
GET /fav/ insert?id=<id>upstream — animedex does not wire this because it’s a write operation against a user account (out-of-scope per read- only-by-scope).Tag list pagination is undersized by default: the upstream’s
totalCountfor/tagsis ~19 butdefaultPageSizeis 30, so a singleanimedex waifu ta gscall returns the entire taxonomy.
The Python library page covers the same surface from inside Python.