<commit_before>%h2.title TreeStats API

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

%ul
  %li
    %a{:href => "#servers"} Servers
  %li
    %a{:href => "#characters"} Characters
  %li
    %a{:href => "#player-counts"} Player Counts
  %li
    %a{:href => "#allegiance"} Allegiances

%h3
  %a{:id => "servers", :href => "#servers"}= "#"
  Servers

To get detailed information about each server registered with TreeStats, send a request to

%pre
  :preserve
    https://treestats.net/servers

with an Accept header of "application/json" and you'll get back a JSON response structured %like:

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

%h3
  %a{:id => "characters", :href => "#characters"}= "#"
  Characters

To get detailed information about a specific character, just append <code>'.json'</code> to the character's URL, e.g.,

%pre
  :preserve
    Before: http://treestats.net/{server}/{character}
    After:  http://treestats.net/{server}/{character}.json

%h4 Example

%h5 Input:

http://treestats.net/WintersEbb/Kolthar%20al%20Magus.json

%h5 Output:

Note: Some values replaced with "..." to make the output shorter and more readable.

%pre
  :preserve
    {
      ...
      "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,
      ...
    }


%h3
  %a{:id => "player-counts", :href => "#player-counts"}= "#"
  Player Counts

Two variants of this endpoint are available: The latest (per server) and all counts going back in time.

%pre http://treestats.net/player_counts-latest.json
%pre http://treestats.net/player_counts.json


%h3
  %a{:id => "allegiance", :href => "#allegiance"}= "#"
  Allegiances

%h4
  %a{:id => "allegiance-characters", :href => "#allegiance-characters"}= "#"
  Allegiance Dump

To get detailed information about every character in an allegiance, just append <code>.json</code> to the allegiance's URL. e.g.,

%pre
  :preserve
    Before: http://treestats.net/allegiances/WintersEbb-A%20group%20of%20normal%20humans
    After:  http://treestats.net/allegiances/WintersEbb-A%20group%20of%20normal%20humans.json

%h4 Example

%h5 Input:

%pre http://treestats.net/allegiances/WintersEbb-A%20group%20of%20normal%20humans.json

%h5 Output:

The output is newline-delimited JSON, with one character per line.

%pre
  :preserve
    {"attribs":{"strength":{"name":"Strength",...
    {"attribs":{"strength":{"name":"Strength",...
    {"attribs":{"strength":{"name":"Strength",...
    {"attribs":{"strength":{"name":"Strength",...

%h4
  %a{:id => "allegiance-chain", :href => "#allegiance-chain"}= "#"
  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 <code>/chain/</code> into the middle of the URL and add a '<code>.json</code>', like:

%pre
  :preserve
    Before: http://treestats.net/{server}/{character}
    After:  http://treestats.net/chain/{server}/{character}


%h4 Example

%h5 Input:

%pre http://treestats.net/chain/WintersEbb/Kolthar%20al%20Magus

%h5 Output:

The output comes in a form suitable for use in a <a href="http://d3js.org/">d3.js</a> chart and follows the form:

%pre
  :preserve
    {
      "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
      ]
    }


%h3
  %a{:id => "allegiance-tree", :href => "#allegiance-tree"}= "#"
  Allegiance Tree

Just append <code>'/tree.json'</code> to an allegiance URL, e.g.,

%pre http://treestats.net/allegiances/WintersEbb-A%20group%20of%20normal%20humans/tree.json

%h4 Example

%h5 Input:

%pre http://treestats.net/allegiances/WintersEbb-A%20group%20of%20normal%20humans/tree.json

%h5 Output:

The output comes in a form suitable for use in a <a href="http://d3js.org/">d3.js</a> chart and follows the form:

%pre
  :preserve
    {
      "nodes": []
      "links": []
    }

where the <code>nodes</code> part is structured as an array of characters that have names and group IDs and the <code>links</code> part is structured as an array of the form <code>[source, target, value]</code>
<commit_msg>Change all URLs on api.haml to use https urls<commit_after>%h2.title TreeStats API

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

%ul
  %li
    %a{:href => "#servers"} Servers
  %li
    %a{:href => "#characters"} Characters
  %li
    %a{:href => "#player-counts"} Player Counts
  %li
    %a{:href => "#allegiance"} Allegiances

%h3
  %a{:id => "servers", :href => "#servers"}= "#"
  Servers

To get detailed information about each server registered with TreeStats, send a request to

%pre
  :preserve
    https://treestats.net/servers

with an Accept header of "application/json" and you'll get back a JSON response structured %like:

%pre
  :preserve
    [
      {
        "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"
        }
      },

%h3
  %a{:id => "characters", :href => "#characters"}= "#"
  Characters

To get detailed information about a specific character, just append <code>'.json'</code> to the character's URL, e.g.,

%pre
  :preserve
    Before: https://treestats.net/{server}/{character}
    After:  https://treestats.net/{server}/{character}.json

%h4 Example

%h5 Input:

https://treestats.net/WintersEbb/Kolthar%20al%20Magus.json

%h5 Output:

Note: Some values replaced with "..." to make the output shorter and more readable.

%pre
  :preserve
    {
      ...
      "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,
      ...
    }


%h3
  %a{:id => "player-counts", :href => "#player-counts"}= "#"
  Player Counts

Two variants of this endpoint are available: The latest (per server) and all counts going back in time.

%pre https://treestats.net/player_counts-latest.json
%pre https://treestats.net/player_counts.json


%h3
  %a{:id => "allegiance", :href => "#allegiance"}= "#"
  Allegiances

%h4
  %a{:id => "allegiance-characters", :href => "#allegiance-characters"}= "#"
  Allegiance Dump

To get detailed information about every character in an allegiance, just append <code>.json</code> to the allegiance's URL. e.g.,

%pre
  :preserve
    Before: https://treestats.net/allegiances/WintersEbb-A%20group%20of%20normal%20humans
    After:  https://treestats.net/allegiances/WintersEbb-A%20group%20of%20normal%20humans.json

%h4 Example

%h5 Input:

%pre https://treestats.net/allegiances/WintersEbb-A%20group%20of%20normal%20humans.json

%h5 Output:

The output is newline-delimited JSON, with one character per line.

%pre
  :preserve
    {"attribs":{"strength":{"name":"Strength",...
    {"attribs":{"strength":{"name":"Strength",...
    {"attribs":{"strength":{"name":"Strength",...
    {"attribs":{"strength":{"name":"Strength",...

%h4
  %a{:id => "allegiance-chain", :href => "#allegiance-chain"}= "#"
  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 <code>/chain/</code> into the middle of the URL and add a '<code>.json</code>', like:

%pre
  :preserve
    Before: https://treestats.net/{server}/{character}
    After:  https://treestats.net/chain/{server}/{character}


%h4 Example

%h5 Input:

%pre https://treestats.net/chain/WintersEbb/Kolthar%20al%20Magus

%h5 Output:

The output comes in a form suitable for use in a <a href="https://d3js.org/">d3.js</a> chart and follows the form:

%pre
  :preserve
    {
      "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
      ]
    }


%h3
  %a{:id => "allegiance-tree", :href => "#allegiance-tree"}= "#"
  Allegiance Tree

Just append <code>'/tree.json'</code> to an allegiance URL, e.g.,

%pre https://treestats.net/allegiances/WintersEbb-A%20group%20of%20normal%20humans/tree.json

%h4 Example

%h5 Input:

%pre https://treestats.net/allegiances/WintersEbb-A%20group%20of%20normal%20humans/tree.json

%h5 Output:

The output comes in a form suitable for use in a <a href="https://d3js.org/">d3.js</a> chart and follows the form:

%pre
  :preserve
    {
      "nodes": []
      "links": []
    }

where the <code>nodes</code> part is structured as an array of characters that have names and group IDs and the <code>links</code> part is structured as an array of the form <code>[source, target, value]</code>

{'fraction_non_alphanumeric': 0.15925408855205425, 'fraction_numerical': 0.030115676106900677, 'mean_word_length': 3.2352195945945947, 'pattern_counts': {'":': 76, '<': 43, '<?xml version=': 0, '>': 79, 'https://': 20, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6150219', 'n_tokens_mistral': 3748, 'n_tokens_neox': 3462, 'n_words': 910}