{
  "openapi": "3.0.1",
  "info": {
    "title": "Chess Player Stats Scraper",
    "description": "Chess.com and Lichess scraper for public player ratings, game history, and leaderboards. It collects profiles, win/loss records by time control, PGN, openings, Chess.com accuracies, titled player lists, and club info from the official APIs. No login.",
    "version": "0.0",
    "x-build-id": "gVvj9qMaopO5ncPYp"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/bigibyte~chess-player-stats-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-bigibyte-chess-player-stats-scraper",
        "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/bigibyte~chess-player-stats-scraper/runs": {
      "post": {
        "operationId": "runs-sync-bigibyte-chess-player-stats-scraper",
        "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/bigibyte~chess-player-stats-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-bigibyte-chess-player-stats-scraper",
        "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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "players",
              "games",
              "leaderboards",
              "titled",
              "club",
              "country",
              "perf"
            ],
            "type": "string",
            "description": "Player profiles, game history, leaderboards, Chess.com titled or country lists, club info, or a Lichess perf report.",
            "default": "players"
          },
          "platform": {
            "title": "Platform",
            "enum": [
              "chesscom",
              "lichess",
              "both"
            ],
            "type": "string",
            "description": "Chess.com, Lichess, or both. A profile URL stays on the site it points to. Titled, club, and country lists are Chess.com. Perf stats are Lichess.",
            "default": "both"
          },
          "usernames": {
            "title": "Usernames or profile URLs",
            "type": "array",
            "description": "Usernames or profile URLs. chess.com/member/x and lichess.org/@/x URLs are accepted, and the platform is detected from the URL.",
            "items": {
              "type": "string"
            }
          },
          "includeClubs": {
            "title": "Include clubs (Chess.com)",
            "type": "boolean",
            "description": "Add the Chess.com clubs listed on the player profile. This makes one extra request per player.",
            "default": false
          },
          "gamesFromMonth": {
            "title": "Games from (YYYY-MM)",
            "pattern": "^\\d{4}-\\d{2}$",
            "type": "string",
            "description": "Oldest month to include, as YYYY-MM. Leave empty to start at the newest games."
          },
          "gamesToMonth": {
            "title": "Games to (YYYY-MM)",
            "pattern": "^\\d{4}-\\d{2}$",
            "type": "string",
            "description": "Newest month to include, as YYYY-MM. Leave empty to include the latest month."
          },
          "timeClasses": {
            "title": "Time classes",
            "type": "array",
            "description": "Keep only these time controls. Leave empty for every time control the site returns.",
            "items": {
              "type": "string",
              "enum": [
                "bullet",
                "blitz",
                "rapid",
                "classical",
                "daily",
                "correspondence",
                "ultraBullet"
              ]
            }
          },
          "includePgn": {
            "title": "Include PGN",
            "type": "boolean",
            "description": "Store the PGN on each game. Turn this off to keep the dataset smaller.",
            "default": true
          },
          "maxGamesPerPlayer": {
            "title": "Max games per player",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Stop after this many games for each player. Newest games are kept first.",
            "default": 200
          },
          "lichessPerf": {
            "title": "Lichess perf (leaderboards/perf)",
            "enum": [
              "bullet",
              "blitz",
              "rapid",
              "classical",
              "ultraBullet",
              "chess960",
              "crazyhouse",
              "kingOfTheHill",
              "threeCheck",
              "antichess",
              "atomic",
              "horde",
              "racingKings"
            ],
            "type": "string",
            "description": "Lichess speed or variant for leaderboard and perf modes.",
            "default": "blitz"
          },
          "leaderboardSize": {
            "title": "Lichess leaderboard size (top N)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "How many Lichess players to take from the top list. Only the top 10 was verified live.",
            "default": 100
          },
          "titles": {
            "title": "Titles (Chess.com titled mode)",
            "type": "array",
            "description": "Chess.com title lists to download, such as GM or IM.",
            "items": {
              "type": "string",
              "enum": [
                "GM",
                "WGM",
                "IM",
                "WIM",
                "FM",
                "WFM",
                "NM",
                "WNM",
                "CM",
                "WCM"
              ]
            },
            "default": [
              "GM"
            ]
          },
          "clubIds": {
            "title": "Chess.com club URL-IDs",
            "type": "array",
            "description": "Club URL ids or club page URLs, for club mode. Example: chess-com-developer-community.",
            "items": {
              "type": "string"
            }
          },
          "countryCodes": {
            "title": "Country ISO codes (Chess.com)",
            "type": "array",
            "description": "Two-letter country codes for Chess.com country mode, such as US or BD.",
            "items": {
              "type": "string"
            }
          },
          "enrichUsernames": {
            "title": "Fetch profiles for listed usernames (titled/country)",
            "type": "boolean",
            "description": "After a titled or country list, fetch each player's profile and ratings. This stays inside the row cap and the one-request-at-a-time rule.",
            "default": false
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Free cap: 20,000 rows per run.",
            "default": 500
          },
          "timeoutSecs": {
            "title": "Run timeout (seconds)",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "Stop the run after this many seconds and keep the rows already saved.",
            "default": 300
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Per-request timeout.",
            "default": 30
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Leave this off. Both sites allow serial requests from a normal connection. Enable it only if you see 403 or 429.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}