API Usage & Docs
This page will guide you on how to properly use the API and what data it provides you.
Fetching the API
The API currently has six endpoints: /world/<world_uuid>, /world/random, /page/<index>, /top/<number>, /owner/<player_uuid>, /search/<query>, and /all
/world/<world_uuid> retrieves the data for the world
with the specified UUID.
/world/random retrieves the data for a random world
/page/<index> retrieves the data for the 27 worlds
in the specified page index. (Imagine a chest with 27 items)
/top/<number> retrieves the data for the top <number> worlds.
/search/<query> retrieves the data for the worlds
that their name closely matches the query.
/top/0 retrieves the data for all worlds, sorted from
the top-ranked to the lowest-ranked.
/owner/<player_uuid> retrieves the data for each
world made by the specified owner.
/all retrieves the data for all worlds, sorted by the
most recently updated.
There are also 2 optional arguments for the /all, /search/<query>, /page/<index>, and /owner/<player_uuid> endpoints.
These are:
?sort - Sorts the world list depending on the value
given.
Options: default|votes|visits|recently_scraped|recently_created. Defaults to default (Online worlds, then player count,
then votes)
?sortDirection - Sorts the direction of the world
list depending on the value given.
Options: ascending|descending.
Defaults to ascending
You can use https://api.legiti.dev/ to call the API
Demo:
Waiting for input...Reading the data
The data is structured differently depending on what endpoint you called, but the world data will always stay the same structure.
Calling /world/<uuid> returns a single object
containing the world's data, while calling any of the other three
will return an array of worlds.
Each world is structured like this:
Higlighting syntax..."world_uuid"- The world's UUID."name"- The world's name in plaintext."description"- The world's description in plaintext."raw_name"- The world's name in Raw JSON Text Component format, preserving styling."raw_description"- The world's description in Raw JSON Text Component format, preserving styling."icon"- The world's item icon in item ID form, including the namespace."votes"- The world's vote count."visits"- The world's visit count."player_count"- The current player count in the world."owner_uuid"- The UUID of the world's owner."creation_date"- The creation date of the world as a string (PST timezone)"creation_date_unix_seconds"- The creation date of the world in UNIX seconds"resource_pack_url"- The download URL for the world's resource pack fromhttps://mc-packs.net/. An empty string if the world has no resource pack."version"- The world's version (for warning purposes only; does not affect the actual version)."locked"- Indicates whether the world is online and running."enforce_whitelist"- Indicates whether the world has a whitelist enforced."jam_world"- Indicates whether the world is currently a jam world. False for worlds that have participated in a jam but were upgraded to a regular world slot."jam_id"- The ID of the jam this world participated in. Null for worlds that weren't part of a jam."whitelist_on_version_change"- Indicates whether the whitelist-on-version-change setting is enabled."last_scraped"- The unix timestamp of the world's last scrape by our bot.
