API/Statistics

From RetroMC
Jump to navigation Jump to search

Back to API

This API page describes the endpoints under api.retromc.org/api/v1/statistics.

GET api.retromc.org/api/v1/statistics/player

Description

This endpoint retrieves a list of nations along with their owner information and village count.

HTTP Method

GET

Request Parameters

  • uuid (required, string): The UUID of the player to retrieve information about.

Response Format

  • uuid (string): The UUID of the player.
  • username (string): The username of the player.
  • online (boolean): If the player is currently on.
  • createdAt (int, UNIX timestamp): When the stats info was created for this user.
  • updatedAt (int, UNIX timestamp): When the stats info was updated for this user.
  • stats (object): The actual stats of the user.
    • firstJoin (int, UNIX timestamp): When the user first joined.
    • lastJoin (int, UNIX timestamp): When the user last joined
    • joinCount (int): amount of joins in their lifetime.
    • creaturesKilled (int): Amount of entities they have killed.
    • playersKilled (int): Amount of people they have killed.
    • blocksPlaced (int): Amount of total blocks placed.
    • blocksDestroyed (int): Amount of total blocks destroyed.
    • metersTravelled (int): Amount of blocks they have travelled.
    • playerDeaths (int): Amount of times they have died.
    • playTime (int): Amount of seconds they have played.
    • money (int): Amount of money they have, on last update.
    • groups (array): List of strings, of what "groups" they are in.
    • itemsDropped (int): Amount of items they have dropped.
    • trustScore (int): Trust score.
    • trustLevel (int): Trust level.
    • country (int): Country code of where they are located.
  • details (object): Extra details about blocks placed/destroyed, and items dropped.
    • blockDetailsPlaced (object): Block IDs (as strings) to amount placed
    • blockDetailsDestroyed (object): Block IDs (as strings) to amount destroyed
    • itemDropDetails (object): Item IDs (as strings) to amount dropped

Example Response

{
  "error": false,
  "uuid": "2cfc6452-a6b4-4c49-982e-492eaa3a14ec",
  "username": "JohnyMuffin",
  "online": true,
  "createdAt": 1547873601,
  "updatedAt": 1790985208,
  "stats": {
    "firstJoin": 1547873601,
    "lastJoin": 1790981154,
    "joinCount": 3184,
    "creaturesKilled": 528,
    "playersKilled": 16,
    "blocksPlaced": 39180,
    "blocksDestroyed": 28380,
    "metersTraveled": 11639131,
    "playerDeaths": 257,
    "playTime": 13992995,
    "money": 6651.056812387069,
    "groups": [
      "admin"
    ],
    "itemsDropped": 7301,
    "trustScore": 2133.2170189374624,
    "trustLevel": 83,
    "country": "AU"
  },
  "details": {
    "blockDetailsPlaced": {
      "0": 1,
      "1": 1,
      "2": 1,
      // ...
    },
    "blockDetailsDestroyed": {
      "1": 15,
      "2": 32,
      "3": 8,
      // ..
    },
    "itemDropDetails": {
      "3": 356,
      "4": 92,
      "6": 18,
      // ...
    }
  }
}

GET api.retromc.org/api/v1/statistics/leaderboard

Description

This endpoint retrieves a list of nations along with their owner information and village count.

HTTP Method

GET

Request Parameters

  • key (string): Key to look for, one of playTime, joinCount, creaturesKilled, playersKilled, blocksPlaced, blocksDestroyed, metersTraveled, playerDeaths, itemsDropped, or trustScore. Defaults to playTime.
  • limit (int): Amount of players to look for, defaults to 10.

Response Format

  • key (string): Key this leaderboard is for.
  • limit (int): Amount of players this leaderboard has looked for.
  • entries (array): List of entries.
    • rank (int): This player's rank on this leaderboard.
    • uuid (string): UUID of the player.
    • username (string): Username of the player.
    • value (number): Actual stat value.

Example Response

{
  "error": false,
  "key": "playTime",
  "limit": 3,
  "entries": [
    {
      "rank": 1,
      "uuid": "413e630d-d87a-4cb7-adaf-01af67d014b2",
      "username": "Orknarok_666",
      "value": 25709956
    },
    {
      "rank": 2,
      "uuid": "d251776a-9df6-49ce-8b38-a59d7b2dc9ee",
      "username": "sshshark",
      "value": 17280576
    },
    {
      "rank": 3,
      "uuid": "2cfc6452-a6b4-4c49-982e-492eaa3a14ec",
      "username": "JohnyMuffin",
      "value": 13992995
    }
  ]
}