animedex.api.waifu

animedex api waifu raw passthrough.

Waifu.im is a free, anonymous JSON API serving a curated collection of anime artwork tagged across SFW and NSFW. Every image record carries an isNsfw boolean; the listing endpoint (/images) defaults to SFW only and accepts an isNsfw query parameter (true / false) to flip the filter, or omits the parameter to honour the default. animedex’s high-level layer exposes this as the transparent --is-nsfw flag — the project’s posture is to surface upstream contracts, not to add a paternalistic confirmation gate.

Backend: Waifu.im (api.waifu.im).

Rate limit: anonymous; not formally published. The transport applies a conservative 10 req/sec sustained ceiling with a 10-token burst budget.

— LLM Agent Guidance — Common read paths: /tags (lists every tag with description and current image count), /images (paginated image listing with optional included_tags, excluded_tags, isNsfw, isAnimated, orderBy filters), and /artists (paginated artist directory). The raw method argument is forwarded verbatim. The isNsfw query parameter defaults to false (SFW only) when omitted; pass true for NSFW only. When the user did not explicitly ask for NSFW content, omit the parameter entirely so the upstream’s SFW default applies. When the user explicitly requested NSFW or adult material, pass it through unmodified — the project’s posture is to inform, not to gate. — End —

call

animedex.api.waifu.call(path: str, *, method: str = 'GET', headers: Dict[str, str] | None = None, params: dict | None = None, no_cache: bool = False, cache_ttl: int | None = None, rate: str = 'normal', follow_redirects: bool = True, user_agent: str | None = None, timeout_seconds: float | None = None, cache=None, session=None, rate_limit_registry=None, config=None) RawResponse[source]

Issue a Waifu.im request and return its envelope.

Parameters:
  • path (str) – URL path on api.waifu.im. Examples: /tags, /images, /artists.

  • headers (dict or None) – Extra request headers (overrides project default User-Agent if supplied).

  • params (dict or None) – Query-string parameters. Common keys for /images: included_tags (repeatable), excluded_tags (repeatable), isNsfw (true / false), isAnimated, orderBy, pageNumber, pageSize.

Returns:

Wire envelope including body, status, headers, redirect chain, request snapshot, timing breakdown, and cache provenance.

Return type:

animedex.api._envelope.RawResponse

selftest

animedex.api.waifu.selftest() bool[source]

Smoke-test the Waifu.im passthrough.

Returns:

True on success; raises on contract drift.

Return type:

bool