github.com/mafredri/go-trueskilld

A simple http API for mafredri/go-trueskill (https://github.com/mafredri/go-trueskill).


Keywords
api, ranking, trueskill
Install
go get github.com/mafredri/go-trueskilld

Documentation

go-trueskilld

A simple http API for go-trueskill.

If the game configuration is not provided in the JSON request, the default configuration for TrueSkillâ„¢ is used.

Example

POST http://localhost:8495/rate

{
  "players": [
    {
      "mu": 25.000,
      "sigma": 8.333
    },
    {
      "mu": 25.000,
      "sigma": 8.333
    }
  ]
}

Response

{
  "players": [
    {
      "mu": 29.396,
      "sigma": 7.171,
      "trueskill": 7.882
    },
    {
      "mu": 20.604,
      "sigma": 7.171,
      "trueskill": 0
    }
  ],
  "probability_of_outcome": 47.759
}

NOTE: If you provide the game configuration in your request, you might encounter rounding errors without sufficient precision. Example (compare probability of outcome to above):

POST

{
  "mu": 25.0,
  "sigma": 8.333,
  "beta": 4.166,
  "tau": 0.083,
  "draw_probability": 10,
  "players": [
    {
      "mu": 25.000,
      "sigma": 8.333
    },
    {
      "mu": 25.000,
      "sigma": 8.333
    }
  ]
}

Response

{
  "players": [
    {
      "mu": 29.396,
      "sigma": 7.171,
      "trueskill": 7.882
    },
    {
      "mu": 20.604,
      "sigma": 7.171,
      "trueskill": 0
    }
  ],
  "probability_of_outcome": 47.76
}