TreeStats API

TreeStats has JSON-based API. Below is a list of endpoints -- please feel free to request more.

Servers

To get detailed information about all the servers registered with TreeStats, send a request to
https://treestats.net/servers.json

Example

Input
https://treestats.net/servers.json
Output
[
  {
    "name": "Reefcull",
    "type": "GDLE",
    "description": "PvE. End-of-Retail.",
    "address": "reefcull.connect-to-server.online:9000",
    "website": "https://reefcull.connect-to-server.online",
    "discord": "https://discord.gg/Rh3UVRs",
    "players": {
      "count": 415,
      "updated_at": "2020-04-25T08:18:04.224Z"
    }
  },

Characters

To get detailed information about a specific character, just append '.json' to the character's URL, e.g.,
Before: https://treestats.net/{server}/{character}
After:  https://treestats.net/{server}/{character}.json

Example

Input:
https://treestats.net/WintersEbb/Kolthar%20al%20Magus.json
Output
{
  ...
  "allegiance_name": "A group of normal humans",
  "birth": "2001-01-28T03:53:22+00:00",
  "created_at": "2015-03-04 19:10:12 +0000",
  "deaths": 178,
  "followers": 7,
  "gender": "Male",
  "level": 234,
  "luminance_total": 1500000,
  "luminance_earned": 6169,
  ...
}

Player Counts

Latest Player Counts

Active Servers
https://treestats.net/player_counts-latest.json
Example
[
  {
    "server": "Levistras",
    "count": 28,
    "date": "2021-10-16 18:27:03 UTC",
    "age": "13 minutes ago"
  },
  ...
]
Single Server
https://treestats.net/player_counts/Levistras.json
Example
{
  "count": 28,
  "created_at": "2021-10-16 18:27:03 +0000",
  "server": "Levistras",
  "age": "7 minutes ago"
}

Historical Player Counts

You can get back historical player counts for all or one server. Defaults to looking three months back in time.
https://treestats.net/player_counts.json
Example
[
  {"server":"Frostcull","date":"20210715","count":54}
  ...
]
Use the servers query parameter to filter to one or more servers. Use commas to separate multiple servers.
https://treestats.net/player_counts.json?servers=Levistras,Coldeve

Allegiances

Allegiance Dump

To get detailed information about every character in an allegiance, just append .json to the allegiance's URL. e.g.,
Before: https://treestats.net/allegiances/WintersEbb-A%20group%20of%20normal%20humans
After:  https://treestats.net/allegiances/WintersEbb-A%20group%20of%20normal%20humans.json

Example

Input:
https://treestats.net/allegiances/WintersEbb-A%20group%20of%20normal%20humans.json
Output
The output is newline-delimited JSON, with one character per line.
{"attribs":{"strength":{"name":"Strength",...
{"attribs":{"strength":{"name":"Strength",...
{"attribs":{"strength":{"name":"Strength",...
{"attribs":{"strength":{"name":"Strength",...

Allegiance Chain

The Allegiance Chain is what backs the tree visualization on the character page. To get the chain view for a character, just insert /chain/ into the middle of the URL and add a '.json', like:
Before: https://treestats.net/{server}/{character}
After:  https://treestats.net/chain/{server}/{character}

Example

Input:
https://treestats.net/chain/WintersEbb/Kolthar%20al%20Magus
Output
The output comes in a form suitable for use in a d3.js chart and follows the form:
{
  "name": "Highest Patron", # Highest patron TreeStats knows about
  "children": [
    {
      "name": "A Vassal"
      "children": [...]     # Recursive set of vassals for this vassal
    },
    {
      "name": "Another Vassal".
      "children": [...]     # Recursive set of vassals for this vassal
    },
    ... # and so on
  ]
}

Allegiance Tree

Example
https://treestats.net/allegiances/WintersEbb-A%20group%20of%20normal%20humans/tree.json
Output
The output comes in a form suitable for use in a d3.js chart and follows the form:
{
  "nodes": []
  "links": []
}
where the nodes part is structured as an array of characters that have names and group IDs and the links part is structured as an array of the form [source, target, value]