HUB
Sign inSign up
anusic-api logo

eoussama/anusic-api

By eoussama

•Updated 3 days ago

Anime themes API

Image
API management
0

435

eoussama/anusic-api repository overview

⁠Anusic

Anusic serves anime opening, ending, and insert themes, with links to their videos and audio, over a simple JSON API. It also groups anime into franchises, and serves song lyrics.

The catalog comes from AnimeThemes⁠. Anusic syncs it once a day, keeps it in memory, and persists it to a volume, so it answers instantly and keeps working when AnimeThemes is unreachable.

⁠Tags

TagDescription
latest, 0.2.0The current release, built on AnimeThemes.
0.0.1 to 0.0.3The original anusic-api, which scraped the r/AnimeThemes wiki. The wiki is gone, so these are no longer maintained.

⁠Quick start

docker run -d --name anusic \
  -p 8000:8000 \
  -v anusic-data:/data \
  --restart unless-stopped \
  eoussama/anusic-api:latest

The same command works with Podman, using docker.io/eoussama/anusic-api:latest as the image. In production, pin a version tag such as 0.2.0 instead of latest.

On its first start, Anusic syncs the whole catalog, which takes about a minute and a half. Until then, the catalog routes answer with 503 CatalogNotReady. Later starts serve the catalog persisted in the volume right away.

Then try:

curl "http://localhost:8000/api/v1/anime?name=titan"

⁠Compose

services:
  anusic:
    image: docker.io/eoussama/anusic-api:latest
    restart: unless-stopped
    ports:
      - "8000:8000"
    volumes:
      - anusic-data:/data

volumes:
  anusic-data:

⁠Configuration

All settings are optional environment variables.

VariableDefaultDescription
ANUSIC_SYNC_INTERVAL24hHow often the catalog is refreshed, such as 6h. 0 only syncs when nothing is persisted yet, or once after an upgrade that fetches more data.
ANUSIC_STALE_AFTERTwice the sync intervalAge after which /healthz reports the catalog as stale. 0 disables it.
ANUSIC_USER_AGENTanusic/<version> (+https://github.com/eoussama/anusic)User agent sent to AnimeThemes and LRCLIB.
ANUSIC_UPSTREAM_URLhttps://rs.animethemes.moe/graphqlAnimeThemes GraphQL endpoint.

The API listens on port 8000, and the catalog and the lyrics cache are stored in /data. Keep /data on a volume, so restarts do not have to sync again.

⁠API

RouteDescription
GET /api/v1/animeAll anime, filtered with ?name= and ?year=.
GET /api/v1/anime/:idAn anime and its themes, by MyAnimeList ID.
GET /api/v1/franchisesAll franchises, filtered with ?name=.
GET /api/v1/franchises/:slugA franchise and its anime.
GET /api/v1/songs/:id/lyricsThe lyrics of a song, by the songId of its themes.
GET /api/openapi.jsonThe OpenAPI 3.1 document of the API.
GET /healthzHealth check, with the size, age, and staleness of the catalog.

See the API reference⁠ for every field, with an interactive console.

⁠Health

GET /healthz answers outside of the usual envelope:

{ "status": "ok", "ready": true, "stale": false, "anime": 5021, "syncedAt": "2026-11-30T14:00:00Z" }

It always answers 200 while the service runs, since a stale catalog is still served and a restart would not fix it. To be alerted, point an uptime monitor at it with a keyword check on "stale":false.

The image has no shell or curl, so a HEALTHCHECK cannot run inside it. Check /healthz from outside instead.

⁠Image

  • A single static Go binary, with no dependencies beyond the standard library.
  • Built on distroless⁠ static-debian13, which ships CA certificates and nothing else.
  • Runs as the non-root user 65532, which owns /data.

⁠Acknowledgments

The theme catalog, videos, and audio are provided by AnimeThemes⁠ and subject to its terms of service⁠. Lyrics are provided by LRCLIB⁠, and remain the property of their respective authors.

⁠License

MIT. See LICENSE⁠.

Tag summary
Recent tags
Content type
Image
Digest
sha256:995016177…
Size
4 MB
Last updated
3 days ago
docker pull eoussama/anusic-api:latest