Mirria HTTP API

This human-readable reference is generated with Maud and is not an OpenAPI document.

All routes are read-only HTTP GET endpoints. JSON endpoints return UTF-8 JSON; downloads return a binary osu! beatmap archive.

JSON response schemas

The four lookup routes and search reuse the following serialized Rust types. Fields marked optional may be JSON null; fields marked omitted are absent when no value exists.

Beatmap

FieldsType and meaning
beatmapset_id, id, mode_int, total_length, hit_length, user_id, ranked, passcount, playcountIntegers: parent set, beatmap and creator IDs; ruleset number; durations in seconds; rank state and play statistics.
difficulty_rating, accuracy, ar, bpm, cs, drainNumbers: star rating, OD, approach rate, tempo, circle size and HP drain.
mode, status, version, urlStrings describing the ruleset, rank status, difficulty name and beatmap URL.
convertBoolean indicating a converted difficulty.
countCircles, countSliders, countSpinners, isScoreableNullable object counts and scoreable flag.
lastUpdatedTimestamp string as stored by the index.
deletedAt, checksum, max_comboOptional deletion timestamp, MD5 checksum and maximum combo; omitted when unavailable.

Beatmapset

FieldsType and meaning
id, user_id, play_count, favourite_count, offset, ranked, track_idInteger identifiers, counts, offset and rank state; track_id is nullable.
artist, artist_unicode, title, title_unicode, creator, status, source, tags, preview_urlMetadata strings; Unicode artist/title variants are nullable.
bpmNumeric tempo.
nsfw, video, storyboard, spotlight, can_be_hyped, discussion_enabled, discussion_locked, has_favouritedBoolean feature and state flags.
is_scoreableNullable scoreable flag.
last_updated, submitted_date, ranked_date, deleted_at, legacy_thread_urlTimestamp or URL strings; all except the first two are nullable.
hype, nominations_summary, availability, coversJSON values retained from the osu! API.
beatmapsArray of Beatmap objects.
pack_tagsArray of strings.
description, ratingsOptional description string and integer array; omitted when unavailable.

GET /api/v1/beatmaps/md5/:checksum

Returns the first indexed beatmapset containing a beatmap with the supplied checksum.

Parameters

LocationNameRequiredDescription
PathchecksumYesBeatmap checksum string, normally an MD5 digest.

Response and statuses

200 OKapplication/json; one Beatmapset object.

Lookup errors do not have a documented JSON body.

Example

curl 'https://mirror.example/api/v1/beatmaps/md5/0123456789abcdef0123456789abcdef'

GET /api/v1/beatmaps/:id

Returns one indexed beatmap difficulty by beatmap ID.

Parameters

LocationNameRequiredDescription
PathidYesSigned 64-bit beatmap ID. A value that cannot be parsed is looked up as ID 0 and normally returns 404.

Response and statuses

200 OKapplication/json; one Beatmap object.

Lookup errors do not have a documented JSON body.

Example

curl 'https://mirror.example/api/v1/beatmaps/4662168'

GET /api/v1/beatmapsets/:id

Returns one indexed beatmapset by beatmapset ID.

Parameters

LocationNameRequiredDescription
PathidYesSigned 64-bit beatmapset ID. A value that cannot be parsed is looked up as ID 0 and normally returns 404.

Response and statuses

200 OKapplication/json; one Beatmapset object.

Lookup errors do not have a documented JSON body.

Example

curl 'https://mirror.example/api/v1/beatmapsets/2556827'

GET /api/v1/beatmapsets/beatmap/:id

Returns the first indexed beatmapset containing the supplied beatmap ID.

Parameters

LocationNameRequiredDescription
PathidYesSigned 64-bit beatmap ID. A value that cannot be parsed is looked up as ID 0 and normally returns 404.

Response and statuses

200 OKapplication/json; one Beatmapset object.

Lookup errors do not have a documented JSON body.

Example

curl 'https://mirror.example/api/v1/beatmapsets/beatmap/4662168'

Map download

GET /api/v1/download/:id and its exact short alias GET /d/:id download an osu! beatmap archive. :id is the numeric beatmapset ID.

Parameters

LocationNameRequired/defaultDescription
PathidRequiredSigned 64-bit beatmapset ID.
Queryvideotrue by defaultBoolean: true returns the normal archive; false requests the upstream no-video variant. Only true and false are valid.

The no-video variant uses the official upstream noVideo=1 option and a separate {id}_novid.osz disk file and RAM cache key, so it never collides with the default {id}.osz archive.

Streaming and cache behavior

RAM and valid disk responses are cache hits; an origin download is a miss. Cached responses and upstream misses stream with backpressure. A miss is published to disk atomically only after the complete upstream body is validated and durably written. Byte-range requests are not supported; downloads return the complete archive.

The bounded smart RAM cache is populated lazily from eligible valid disk files or bytes already flowing through a request. Policy refresh never prefetches from the origin. Every ten minutes it retains candidates from the 50 latest ranked maps and the top 30 maps by successful download count, using the most recent successful download time and then map ID to break count ties. Entries outside that union are evicted, and byte capacity always wins, so a small cache may hold fewer maps. Video variants have independent byte entries.

RAM hits clone the retained byte buffer without copying its contents. An archive larger than the configured capacity is still served and kept on disk but is not admitted to RAM. Capacity bounds bytes owned or reserved by the cache; response clones already in flight may outlive eviction.

RAM capacity configuration

The cache_size setting is read from Mirria's confy YAML configuration at API startup. It defaults to "10%". Values are trimmed and case-insensitive:

cache_size: "2048MB"
# or
cache_size: "4GB"
# or
cache_size: "10%"

Successful response (200)

application/x-osu-beatmap-archive binary body.

HeaderMeaning
Content-Typeapplication/x-osu-beatmap-archive
Content-DispositionAttachment filename; UTF-8 names use RFC 5987 encoding.
Content-LengthArchive length when known.
X-Cache-Hithit for RAM or disk, or miss for an upstream stream.
X-RateLimit-RemainingReservations still available in the applicable client window after this request was reserved.
X-RateLimit-ResetWhole seconds remaining until the applicable fixed window resets (0 through 5).

Rate limits

Clients are identified by their direct peer IP address; forwarding headers are intentionally not trusted. Cached and non-cached downloads have independent five-second fixed windows.

Capacity is reserved before file or upstream work begins, preventing concurrent requests from bypassing a limit. A reservation is committed only when its response body completes successfully; upstream, cache-file, streaming or abandoned-client failures refund it.

Error responses

StatusMeaningBody/headers
400 Bad RequestThe path ID or video boolean could not be parsed.Axum rejection body; no stable JSON schema.
429 Too Many RequestsThe applicable client window has no capacity. No download or cache-file stream is started.JSON error body; X-RateLimit-Remaining: 0, plus matching delta-seconds values in X-RateLimit-Reset and Retry-After.
500 Internal Server ErrorThe local cache could not be prepared, inspected or opened.{"ok":false,"message":"..."}
502 Bad GatewayThe upstream download could not be started, declared an empty body or returned a non-success status.{"ok":false,"message":"..."}

Examples

# Default archive, including video when the set has one
curl -OJ 'https://mirror.example/api/v1/download/2556827'

# No-video variant through the short alias
curl -OJ 'https://mirror.example/d/2556827?video=false'

GET /metrics

Returns the current Prometheus metrics exposition generated by the HTTP metrics recorder. Metric series and labels depend on observed runtime traffic.

Parameters

No path or query parameters.

Response and statuses

200 OK — Prometheus text exposition returned as text/plain; charset=utf-8. This handler defines no route-specific error status.

Example

curl 'https://mirror.example/metrics'
# HELP <metric_name> <description>
# TYPE <metric_name> counter
<metric_name>{...} <value>

GET /docs

Serves this generated, human-readable API reference.

Parameters

No path or query parameters.

Response and statuses

200 OKtext/html; charset=utf-8. This handler defines no route-specific error status.

Example

curl 'https://mirror.example/docs'