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 tiertargetSize. 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.
| Tier | Original short edge | Upscale targetSize |
|---|---|---|
| S | 0–511 px | 640 px |
| M | 512–639 px | 768 px |
| L | 640–719 px | 896 px |
| XL | 720 px and up | 960 px |
Parameters
| Name | Applies to | Values |
|---|---|---|
| tier | /random, /mugis | S, M, L, XL. Filters by catalog cropQuality. |
| variant | all routes | upscaled (default) → mugis_up/. original → mugis/. |
| format | /random | Omit 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/randomWith filters
https://api.mugitime.cc/random?tier=XL&variant=originalJSON
https://api.mugitime.cc/random?format=json&tier=MHTML
<img src="https://api.mugitime.cc/random?tier=XL" alt="" />curl
curl -sS 'https://api.mugitime.cc/random?format=json&tier=M'302—Redirect to JPEG (default)200—JSON body when format=json400—Unknown tier or variant404—No 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/mugisFiltered
https://api.mugitime.cc/mugis?tier=S&variant=originalResponse envelope
{
"count": 1485,
"tier": null,
"variant": "upscaled",
"items": [ /* …objects… */ ]
}200—Catalog payload400—Unknown 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/42Original
https://api.mugitime.cc/download/42?variant=originalcurl
curl -sSL -o mugi_42.jpg 'https://api.mugitime.cc/download/42'200—Image body (usually image/jpeg)400—Invalid id or variant404—Id not in catalog502—CDN upstream failed
Errors
Error bodies are JSON: { "error": "…" }.