Elo Rating
Calculate updated Elo ratings for two players after a match. Supports custom K-factor for different competitive contexts.
⚡ 1 credit per call
Try it
Fill in the fields below and hit Send.
Why use this
LLMs can miscalculate Elo deltas, especially around edge cases with unequal ratings or non-standard K-factors. Use this for accurate, deterministic rating updates in games, competitions, or ranking systems.
Input
| Field | Type | Required | Description |
|---|---|---|---|
rating_a |
number | ✓ | Current rating of player A |
rating_b |
number | ✓ | Current rating of player B |
outcome |
a_wins | b_wins | draw |
✓ | Result of the match |
k_factor |
number | — | Sensitivity factor (default 32). Use 16 for established players, 64 for new players |
Response
| Field | Type | Description |
|---|---|---|
new_rating_a |
number | Updated rating for player A |
new_rating_b |
number | Updated rating for player B |
delta_a |
number | Points gained or lost by player A |
delta_b |
number | Points gained or lost by player B |
expected_score_a |
number | Player A's expected win probability (0–1) |
API Reference
Endpoint
POST https://api.lightningapi.tools/elo-rating
Required headers
Authorization: Bearer <apiKey>
Content-Type: application/json
Example request
{
"rating_a": 1200,
"rating_b": 1000,
"outcome": "a_wins",
"k_factor": 32
}
Example response
{
"new_rating_a": 1207,
"new_rating_b": 993,
"delta_a": 7,
"delta_b": -7,
"expected_score_a": 0.76
}