User:Eleanorsilly/API research

From MinecraftOnline
Jump to navigation Jump to search

MCO has an "API" ; the main endpoint is https://minecraftonline.com/cgi-bin/. This API has no documentation, and this page is meant to create some. Feel free to add content.

Player related

Note: None of these are case sensitive.

Time connected


First seen


Last seen


Ban reason

General information


Lists



Other




Location-related

Output of the getnearestplace API
  • Get nearest place : https://minecraftonline.com/cgi-bin/getnearestplace, returns a JSON output (see picture). The input works as follow :
      • If there is 1 number, it will assumed to be both the x and z coordinate.
      • If there are 2 numbers, the first number will be the x coordinate and the 2nd the z coordinate (the 2 numbers are separated by commas)
      • If there are 3 numbers, the first number will be the x coordinate, the 2nd the y coordinate and the 3rd the z coordinate (the 3 numbers are separated by commas)
    • The system doesn't accept decimal numbers. If you put a . after a number and then another number, the 2 numbers will be multiplied. It do accepts negative number however (of course).
    • Example URL : https://minecraftonline.com/cgi-bin/getnearestplace?-6145,40,-18060

Map-related

Output of the getmapiteminfo API

Other

  • Get random render : https://minecraftonline.com/cgi-bin/getrandomrenders, returns 10 renders in this form:
    • username:x-coord (decimal):y-coord (same):z-coords (same):number? (decimal):number? (decimal):request time? (UNIX timestamp):start generation time? (UNIX timestamp):end generation time (UNIX timestamp):imgur URL
    • The 10 renders are separated by line returns (LF, not CR+LF)

  • Get the end of the Minecraft chat : https://minecraftonline.com/cgi-bin/tailminecraftlog.sh, returns the 20 last line of the chat, with [MCS], [DSC] and [IRC] prefixes (and likely a [TG] prefix too)
    • Every user, on Discord, MC and IRC, get their username with < and > around it, except in IRC and MC join messages
    • Note: this isn't very up-to-date most of the time, with delays like a minute possible. The script only updates the page when the last 20 lines have changed.
    • Note 2: special characters (accents etc) are formatted to be shown as in HTML. Also, every line finishes by <br /> AND a line return (LF, not CR+LF).
    • Note 3: this works even if the server is down/during time outs
    • Note 4: in case of hard fails, it returns \n

  • Generate the main page's content with no CSS (easy scraping): https://minecraftonline.com/cgi-bin/generatesideboxes.sh, returns a basic HTML page
    • Things that can be scraped from it:
      • Server status (may be incorrect in case of hard fails)
      • Player count (although that can be calculated from the player list) (may also be incorrect in case of hard fails)
      • Unique players from yesterday
      • Homes number
      • Admins/moderators number (same as player count, can be calculated through the list)

Do not work anymore



Notes

If any player related request is asked with an unknown player, it'll return NOTFOUND.

Some of these may have trailing line returns, remember to clear those.