Discord API About Download Decal Plugin

TreeStats API

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

# Characters

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

Example

Input:
http://treestats.net/WintersEbb/Kolthar%20al%20Magus.json
Output:
Note: Some values replaced with "..." to make the output shorter and more readable.
{
  ...
  "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

Two variants of this endpoint are available: The latest (per server) and all counts going back in time.
http://treestats.net/player_counts-latest.json
http://treestats.net/player_counts.json

# 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: http://treestats.net/{server}/{character}
After:  http://treestats.net/chain/{server}/{character}

Example

Input:
http://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

Just append '.json' to an allegiance URL, e.g.,
http://treestats.net/allegiances/WintersEbb-A%20group%20of%20normal%20humans.json

Example

Input:
http://treestats.net/allegiances/WintersEbb-A%20group%20of%20normal%20humans.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]