animedex.api.nekos

animedex api nekos raw passthrough.

nekos.best v2 is a free, anonymous JSON API serving a curated SFW collection of anime imagery and GIFs. Each record carries url (the asset), plus best-effort attribution (anime_name / artist_name / artist_href / source_url) and dimensions (width / height).

Backend: nekos.best v2 (nekos.best/api/v2).

Rate limit: 200 req/min anonymous. The cap is visible in the x-rate-limit-limit ("1m" window) and x-rate-limit-remaining response headers; the transport applies a 3 req/sec sustained ceiling with a 10-token burst budget to stay under it.

— LLM Agent Guidance — Common read paths: /endpoints (lists all categories and their per-category file format); /<category>?amount=N (retrieves N random images / GIFs from that category, 1 <= N <= 20); /search?query=...&type=1|2&category=<name>&amount=N (metadata search across artist / source / anime fields, type=1 for images and type=2 for GIFs). The raw method argument is forwarded verbatim. All v2 categories are SFW; the high-level rich-model projection sets rating='g' unconditionally. A 404 on /<category> means the category name is unknown — call /endpoints to discover the valid set. — End —

call

animedex.api.nekos.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 nekos.best v2 request and return its envelope.

Parameters:
  • path (str) – URL path under /api/v2. Examples: /endpoints, /husbando, /neko, /search.

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

  • params (dict or None) – Query-string parameters. amount=N for /<category>; query=...&type=1|2&category=...&amount=N for /search.

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.nekos.selftest() bool[source]

Smoke-test the nekos.best passthrough.

Returns:

True on success; raises on contract drift.

Return type:

bool