animedex trace

Trace.moe identifies an anime scene from a screenshot or short clip and returns the matching show, episode, and timestamp. animedex wraps its two anonymous endpoints as the trace search and trace quota subcommands.

animedex trace demo — quota check, URL search, similarity projection

References

Site

https://trace.moe/

API documentation

https://soruly.github.io/trace.moe-api/

Project repo

https://github.com/soruly/trace.moe-api

Python module

animedex.backends.trace

Rich models

animedex.backends.trace.models

  • Backend: Trace.moe (api.trace.moe).

  • Rate limit: anonymous concurrency 1, quota 100 / month (down from the older 1000 / month tier — the upstream tightened in 2025). Per-call cost surfaces in trace quota.

  • Auth: anonymous tier covers everyday use; authenticated tiers raise the quota and are not yet wired into animedex.

Quota check — quota()

The /me endpoint costs nothing and is the cheap way to confirm your tier and budget:

animedex trace quota
# Trace.moe quota  [src: trace]
#   Tier priority:    0  (anonymous)
#   Concurrency:      1
#   Used / quota:     5 / 100  (5.0% used)
#   Remaining:        95

animedex trace quota --json --jq '{tier: .priority, used: .quota_used, total: .quota}'
# => {
#      "tier":  0,
#      "used":  5,
#      "total": 100
#    }

The TTY rendering uses the cross-source TraceQuota projection which does not surface the upstream’s ``id`` field. The reason: id on /me is the caller’s egress IP, which is the caller’s own datum but not something the project surfaces by default. The rich shape RawTraceQuota carries it for callers who want it (model_dump(by_alias=True) round-trips losslessly).

Endpoint summary

Command

Python entry point

Purpose

trace search [--url|--input]

animedex.backends.trace.search()

identify an anime scene from a screenshot, URL or stdin

trace quota

animedex.backends.trace.quota()

zero-cost tier / quota check via /me

Crossing into AniList

A typical workflow:

  1. Take a screenshot of an anime scene.

  2. animedex trace search --input scene.png --anilist-info.

  3. Pull the AniList ID from the top hit.

  4. animedex anilist show <id> for the full show metadata.

With --anilist-info set, step 3 is essentially free — the AniList title is inlined.

Gotchas

  • Quota is shared with anyone on the same egress IP. A shared NAT or a busy office network may already have spent the daily allowance before you start; trace quota is the cheap (no-quota-cost) check.

  • Concurrency 1: don’t run trace search in parallel. animedex’s per-backend rate-limit bucket caps concurrency at 1 automatically; if you bypass the CLI and hit the API directly, obey the same cap.

  • Public-image-URL caveat: --url requires the image to be fetchable by Trace.moe’s servers. If your image is on a host that blocks data-centre egress, upload via --input instead.

The Python library page covers the same surface from inside Python.