API Documentation

Base URL: https://api.mugitime.cc

All listed routes are GET. Responses include Access-Control-Allow-Origin: *. The same handlers also answer on https://mugitime.cc/api/….

Media variants

Each portrait exists in two CDN prefixes under cdn.mugitime.cc. Same id / filename in both; pixels and catalog dimensions differ.

  • variant=upscaled (default) — mugis_up/. RealESRGAN upscale, short edge resized to the tier targetSize. What the site viewer uses.
  • variant=original mugis/. Source crops as extracted (no ESRGAN). Smaller files; native crop resolution.

Quality tiers

Tier is assigned from the original crop's short edge (min of width and height) and stored as cropQuality / API tier. Upscale output targets the matching targetSize.

TierOriginal short edgeUpscale targetSize
S0–511 px640 px
M512–639 px768 px
L640–719 px896 px
XL720 px and up960 px

Parameters

NameApplies toValues
tier/random, /mugisS, M, L, XL. Filters by catalog cropQuality.
variantall routesupscaled (default) → mugis_up/. original mugis/.
format/randomOmit for 302 to the JPEG. json returns the object below.

Object schema

Returned by /random?format=json and as each entry in /mugis items.

Example

{
  "id": 42,
  "filename": "mugi_42.jpg",
  "url": "https://cdn.mugitime.cc/mugis_up/mugi_42.jpg",
  "episode": "S01E03",
  "timecodeSeconds": 752.4,
  "width": 960,
  "height": 960,
  "tier": "XL",
  "targetSize": 960,
  "variant": "upscaled"
}

GET /random

Selects one catalog entry at random. Without format=json, responds with 302 and Location set to the CDN image URL (Cache-Control: no-store). Suitable as an <img src>.

Request

https://api.mugitime.cc/random

With filters

https://api.mugitime.cc/random?tier=XL&variant=original

JSON

https://api.mugitime.cc/random?format=json&tier=M

HTML

<img src="https://api.mugitime.cc/random?tier=XL" alt="" />

curl

curl -sS 'https://api.mugitime.cc/random?format=json&tier=M'
  • 302Redirect to JPEG (default)
  • 200JSON body when format=json
  • 400Unknown tier or variant
  • 404No items match the filter

GET /mugis

Returns the catalog as JSON. Optional tier / variant narrow the list. Cached at the edge (Cache-Control: public, max-age=3600, s-maxage=86400).

Request

https://api.mugitime.cc/mugis

Filtered

https://api.mugitime.cc/mugis?tier=S&variant=original

Response envelope

{
  "count": 1485,
  "tier": null,
  "variant": "upscaled",
  "items": [ /* …objects… */ ]
}
  • 200Catalog payload
  • 400Unknown tier or variant

GET /download/{id}

Streams the JPEG for catalog id id through this origin. Response: upstream Content-Type (usually image/jpeg), Content-Disposition: attachment with mugi_{id}.jpg, Cache-Control: private, no-store. Optional variant as above.

Request

https://api.mugitime.cc/download/42

Original

https://api.mugitime.cc/download/42?variant=original

curl

curl -sSL -o mugi_42.jpg 'https://api.mugitime.cc/download/42'
  • 200Image body (usually image/jpeg)
  • 400Invalid id or variant
  • 404Id not in catalog
  • 502CDN upstream failed

Errors

Error bodies are JSON: { "error": "…" }.