animedex.api.anilist

animedex api anilist raw passthrough.

AniList is a single-endpoint GraphQL service: every read goes POST /. This module is a thin shim over animedex.api._dispatch.call(); the dispatcher owns all envelope assembly, rate limiting, caching, and credential redaction.

Backend: AniList (graphql.anilist.co). GraphQL with introspection.

Rate limit: 30 req/min (currently degraded; baseline 90/min).

— LLM Agent Guidance — This wraps a single GraphQL endpoint. Pass a complete GraphQL document as the body. For per-query variables, also pass a variables mapping. The 30 req/min cap is enforced client-side; calls beyond the budget block until a token is available. Anonymous reads cover the public schema (Media, Character, Staff, Studio, Page); a token unlocks the viewer’s own scopes which are out of the substrate API layer scope. — End —

call

animedex.api.anilist.call(query: str, *, method: str = 'POST', variables: Dict[str, Any] | None = None, headers: Dict[str, str] | 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 an AniList GraphQL request and return its envelope.

Parameters:
  • query (str) – GraphQL document.

  • method (str) – HTTP method; POST is the normal GraphQL read path.

  • variables (dict or None) – GraphQL variables, optional.

  • headers (dict or None) – Caller-supplied headers (override defaults).

  • no_cache (bool) – Skip cache lookup and write.

  • cache_ttl (int or None) – Override TTL in seconds.

  • rate (str) – "normal" or "slow".

  • follow_redirects (bool) – Whether to follow 3xx automatically.

  • user_agent (str or None) – Override the project default UA.

  • timeout_seconds (float or None) – HTTP timeout in seconds; None falls back to the dispatcher’s default (30 s).

  • cache – SqliteCache instance.

  • session – requests.Session.

  • rate_limit_registry – RateLimitRegistry.

Returns:

Envelope.

Return type:

RawResponse

selftest

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

Smoke-test the AniList passthrough.