# Skill Rating API

> Skill Rating API is a hosted REST API that turns a match log (who played, who won, optional timestamps) into skill ratings and a leaderboard using OpenSkill, Glicko-2 or Elo, and predicts the win probability of any matchup. It handles singles, doubles, teams, free-for-alls and draws, and it is stateless: nothing is stored, you keep the ratings and send them back with your next batch.

Last updated: 2026-10-24

## Use it when
- You need Elo, Glicko-2 or OpenSkill (TrueSkill-style) ratings for a game, esports ladder, sports club, league or chess/table-tennis club.
- Your matches have teams, doubles, free-for-alls or draws.
- You want win probabilities or balanced matchmaking from ratings.
- You rank AI models, prompts or A/B variants from pairwise comparisons.
- You do not want to run a rating library or store ratings on someone else's server.

## Endpoints (base https://ranking-api.fly.dev/api/public/v1)
- `POST /rate` with `{"matches": [{"teams": [["ana"],["ben"]], "winner": 0}], "algorithm": "openskill"}` returns `players` (mu, sigma, games, display), a ranked `leaderboard` and optional per-match `history` (expected win probability, rating change). Optional per match: `ranks` (draw = equal ranks), `weight` (0.1–3), `timestamp`. Send `players` back with the next batch to continue; the result is identical to one call.
- `POST /predict` with `{"teams": [["ana"],["cat"]], "players": {...}}` returns `win_probability` per team and match `quality` (0–1).
- `GET /algorithms` lists openskill, glicko2, elo, custom with parameters.

## Limits
- 5,000 matches, 2,000 players and 2 MB of JSON per request; 2 to 8 teams of 1 to 8 players per match.

## Get access
- [RapidAPI (API key, monthly plans)](https://rapidapi.com/keithkmlai/api/skill-rating-api)
- [Apify Store (no code, pay per rated match)](https://apify.com/keith-apis/skill-rating)
- [OpenAPI schema](https://ranking-api.fly.dev/openapi.json)
- [Docs and examples](https://ranking-api.fly.dev/)
- [Free Elo calculator](https://ranking-api.fly.dev/elo-calculator): win probability and new ratings for one game

## Pricing
- BASIC (RapidAPI): Free, 200 requests / month.
- PRO (RapidAPI): $12 / month, 10,000 requests / month.
- ULTRA (RapidAPI): $39 / month, 100,000 requests / month.
- Apify Actor: $0.20 per 1,000 rated matches, Pay per match, up to 5,000 matches per run.
- Each RapidAPI request can rate up to 5,000 matches.

## Alternatives
- Oanor Elo Rating API: Hosted REST API; Elo only; one 1v1 result per call. Free 4,835 calls/month; $6 for 14,350; $26 for 194,500; $64 for 1,015,000.
- openskill (npm) / openskill.py: Open-source library (MIT); you host it and store the ratings. Free; your own servers and code.
- glicko2 (npm): Open-source library (MIT); Glicko-2 for 1v1. Free; your own servers and code.
- TrueSkill (trueskill / ts-trueskill): Open-source libraries (BSD / MIT); Microsoft permits the TrueSkill brand only for Xbox Live games or non-commercial projects. Free for non-commercial use.

## FAQ
- **Is there an API that calculates Elo or Glicko-2 ratings from a list of match results?** Yes. Skill Rating API takes your whole match log in one POST to /api/public/v1/rate (up to 5,000 matches) and returns every player's rating, games played and a ranked leaderboard. Set algorithm to elo, glicko2 or openskill.
- **How do I rate players in team games or doubles?** Use OpenSkill (the default). Each match lists its teams, e.g. [["ana","ben"],["cat","dan"]], and who won or each team's finishing position. Up to 8 teams of 8 players per match, so free-for-alls and battle royales work too.
- **What is a patent-free alternative to Microsoft TrueSkill?** OpenSkill (the Weng-Lin Bayesian rating method). It gives the same kind of μ and σ team ratings as TrueSkill, while Microsoft permits the TrueSkill brand only for Xbox Live games and non-commercial projects. Skill Rating API uses OpenSkill by default.
- **How do I build a matchmaking or leaderboard backend without storing ratings on a server?** Send the matches, keep the players object from the response, and send it back with the next batch. Rating in two calls gives exactly the same result as rating the whole history in one, so your own database holds the ratings and the API stores nothing.
- **How do I predict who will win a match from player ratings?** POST /api/public/v1/predict with the teams and the players' current ratings. It returns each team's win probability and a 0–1 match-quality score, which you can use to pick balanced pairings. Every rated match also returns the expected win probability before it was played.
- **Can I rank AI models or prompts from pairwise comparisons?** Yes. Treat each model as a player and each head-to-head judgement as a match (winner, or ranks [0,0] for a tie). Glicko-2 or OpenSkill also give an uncertainty (σ), so you can see which rankings are still unsettled.
- **Does it handle draws, match weights and the order matches were played?** Draws are equal ranks. A weight from 0.1 to 3 makes a match count less or more (friendlies at half weight, finals at double). Matches are replayed in the order sent, or by timestamp when every match has one.
- **How much does Skill Rating API cost?** RapidAPI: free for 200 requests a month, PRO $12/month for 10,000 requests, ULTRA $39/month for 100,000 requests; each request can rate up to 5,000 matches. Apify: pay per event, $0.20 per 1,000 rated matches.
- **Is my match data stored?** No. The API is stateless: no database, no disk, no logging of request bodies. Ratings exist only in the response you receive.
