Public API

  • Views Views: 2,028
  • Last updated Last updated:
  • Public API

    Eternal Realms provides a public api to gather information about stats, servers and player.

    Each IP is allowed 100 requests per minute. If your use case requires more than this, please contact us.

    Base URL

    https://api.eternal.gs/

    Content Type

    By default, all responses will be returned in JSON. To receive a XML response, append .xml to your URI.

    Public Endpoints

    • /online - Display all online players
    • /online/staff - Display all online staff.
    • /user - Lookup a user based on Name, Id, or UUID.
    • /stats - Various statistics about the server.
    • /servers - Information on the state of the servers.

    Online Players

    · /online/[server-name]

    For this endpoint, by default all players across all servers will be returned. If you wish to get data from a specific server, you can append the endpoint with a valid server name.

    https://api.eternal.gs/online/survival
    [
        {
            "group": 1,
            "name": "Kashall",
            "user_id": 19,
            "start": 1607060141
        }
    ]
    Please see the servers endpoint to fetch a list of available servers.


    Online Staff

    · /online/staff

    This endpoint will return a list of online staff members and what server they are currently located on.

    https://api.eternal.gs/online/staff
    {
        "survival": [
            {
                "group": 10,
                "name": "willies952002",
                "user_id": 1,
                "start": 1606987996
            }
        ],
        "stage": [],
        "dev": []
    }
    

    User Data

    · /user/[username | id | uuid]

    This endpoint will display public player data when sent a valid username, id or uuid. If the user is banned, it will show who and why they were banned.

    https://api.eternal.gs/user/Kashall
    {
        "user_id": 19,
        "uuid": "3491fc09-13ba-4624-b3cc-da8e87f0230f",
        "name": "Kashall",
        "group_id": 1,
        "first_login": 1581216818,
        "last_seen": 1607060140,
        "server_id": "survival",
        "voting": {
            "bonus": 4,
            "last": 1606967899,
            "max": 14,
            "sites": {
                "mcsl": 1606967843,
                "minecraft-mpcom": 1606889265,
                "minecraftbuzz": 1606967899,
                "minecraftserversbiz": 1606967880,
                "planetminecraftcom": 1606889345,
                "serverpactcom": 1606967854,
                "topgorg": 1606967840
            }
        },
        "texp": {
            "month": 0,
            "life": 0
        }
    }
    

    Server Stats

    · /stats

    This endpoint will return statistics about all servers on the network.

    https://api.eternal.gs/stats
    {
        "players": {
            "total": 383,
            "online": 4,
            "new": 48,
            "registered": 59,
            "supporter": 0
        },
        "sessions": {
            "day": 74,
            "week": 313,
            "month": 1566,
            "avg_len": 3495
        },
        "chat_messages": {
            "day": 272,
            "week": 1015,
            "month": 3849,
            "avg_len": 21
        },
        "servers": {
            "avg_ping": 25
        }
    }
    

    Server Data

    · /servers

    This endpoint will return data about all servers on the network.

    https://api.eternal.gs/servers
    {
        "survival": {
            "server_id": 1,
            "title": "survival",
            "server_status_id": 0,
            "message": "",
            "max_players": 50,
            "online_count": 4
        },
        "stage": {
            "server_id": 100,
            "title": "stage",
            "server_status_id": 0,
            "message": "",
            "max_players": 500,
            "online_count": 0
        },
        "dev": {
            "server_id": 999,
            "title": "dev",
            "server_status_id": 0,
            "message": "",
            "max_players": 45,
            "online_count": 0
        }
    }