{
  "openapi": "3.0.1",
  "info": {
    "title": "Skill Rating — OpenSkill, Glicko-2 & Elo from match results",
    "description": "Turn a match log into skill ratings and a leaderboard with OpenSkill (patent-free TrueSkill alternative), Glicko-2 or Elo, plus win probabilities. Singles, doubles, teams, free-for-alls and draws. $0.20 per 1,000 rated matches.",
    "version": "1.1",
    "x-build-id": "jHVNvvwII3vLa2O8C"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/keith-apis~skill-rating/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-keith-apis-skill-rating",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/keith-apis~skill-rating/runs": {
      "post": {
        "operationId": "runs-sync-keith-apis-skill-rating",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/keith-apis~skill-rating/run-sync": {
      "post": {
        "operationId": "run-sync-keith-apis-skill-rating",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "matches"
        ],
        "properties": {
          "matches": {
            "title": "Matches",
            "type": "array",
            "description": "Your match history. Each match: \"teams\" (2–8 teams of 1–8 player ids; singles = one id per team) and who won: \"winner\" (team index, default 0) or \"ranks\" (finishing position per team; equal ranks = draw). Optional: \"weight\" 0.1–3 and \"timestamp\" (ISO 8601 or epoch ms; if every match has one they are rated in time order, otherwise in list order). Charged per rated match.",
            "default": [
              {
                "teams": [
                  [
                    "ana"
                  ],
                  [
                    "ben"
                  ]
                ],
                "winner": 0,
                "timestamp": "2026-10-01T18:00:00Z"
              },
              {
                "teams": [
                  [
                    "cat"
                  ],
                  [
                    "dan"
                  ]
                ],
                "winner": 1,
                "timestamp": "2026-10-01T18:30:00Z"
              },
              {
                "teams": [
                  [
                    "ana",
                    "dan"
                  ],
                  [
                    "ben",
                    "cat"
                  ]
                ],
                "winner": 0,
                "timestamp": "2026-10-02T19:00:00Z"
              },
              {
                "teams": [
                  [
                    "ana"
                  ],
                  [
                    "dan"
                  ]
                ],
                "ranks": [
                  0,
                  0
                ],
                "timestamp": "2026-10-03T18:00:00Z"
              },
              {
                "teams": [
                  [
                    "ben"
                  ],
                  [
                    "cat"
                  ]
                ],
                "winner": 0,
                "weight": 0.5,
                "timestamp": "2026-10-03T18:45:00Z"
              },
              {
                "teams": [
                  [
                    "ana"
                  ],
                  [
                    "cat"
                  ]
                ],
                "winner": 0,
                "timestamp": "2026-10-04T18:00:00Z"
              }
            ]
          },
          "algorithm": {
            "title": "Algorithm",
            "enum": [
              "openskill",
              "glicko2",
              "elo"
            ],
            "type": "string",
            "description": "OpenSkill is the patent-free TrueSkill alternative and handles teams natively. Glicko-2 adds uncertainty for 1v1. Elo is one number with a K-factor.",
            "default": "openskill"
          },
          "players": {
            "title": "Existing ratings (optional)",
            "type": "object",
            "description": "The `players` object from a previous run's OUTPUT record, to continue where you left off. The result is identical to rating the whole history in one run."
          },
          "predict": {
            "title": "Matchups to predict (optional)",
            "type": "array",
            "description": "Hypothetical matches, each a list of teams, e.g. [[\"ana\"],[\"cat\"]]. Returns each team's win probability and a 0–1 match quality from the final ratings, in the OUTPUT record. Not charged.",
            "default": [
              [
                [
                  "ana"
                ],
                [
                  "cat"
                ]
              ],
              [
                [
                  "ana",
                  "ben"
                ],
                [
                  "cat",
                  "dan"
                ]
              ]
            ]
          },
          "params": {
            "title": "Algorithm parameters (optional)",
            "type": "object",
            "description": "Override defaults, e.g. {\"k\": 24} for Elo or {\"tau\": 0.5} for Glicko-2. The ratings API's GET /algorithms lists every key."
          },
          "includeHistory": {
            "title": "Include per-match history",
            "type": "boolean",
            "description": "Add each match's expected win probability and rating changes to the OUTPUT record.",
            "default": false
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}