{
  "openapi": "3.0.1",
  "info": {
    "title": "Football xG Scraper: Understat Matches, Shots & Tables",
    "description": "Understat xG data as clean rows: xG league tables, fixtures and results with xG and win probabilities, team match logs (xG, xGA, PPDA), player stats per 90, every shot with xG, lineups and player match logs. Premier League, La Liga, Bundesliga, Serie A, Ligue 1. No login.",
    "version": "1.0",
    "x-build-id": "cKGA3Wkp4QuyxV07C"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/serenido~football-xg-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-serenido-football-xg-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/serenido~football-xg-scraper/runs": {
      "post": {
        "operationId": "runs-sync-serenido-football-xg-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/serenido~football-xg-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-serenido-football-xg-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",
        "properties": {
          "mode": {
            "title": "What to get",
            "enum": [
              "table",
              "matches",
              "teamMatches",
              "players",
              "shots",
              "lineups",
              "playerMatches"
            ],
            "type": "string",
            "description": "Pick one per run. Every mode uses Understat's public data, no login.",
            "default": "table"
          },
          "leagues": {
            "title": "Leagues",
            "type": "array",
            "description": "One or more leagues. Used by every mode except player match logs and shots/lineups for given match links.",
            "items": {
              "type": "string",
              "enum": [
                "EPL",
                "La_liga",
                "Bundesliga",
                "Serie_A",
                "Ligue_1",
                "RFPL"
              ],
              "enumTitles": [
                "Premier League (England)",
                "La Liga (Spain)",
                "Bundesliga (Germany)",
                "Serie A (Italy)",
                "Ligue 1 (France)",
                "Russian Premier League"
              ]
            },
            "default": [
              "EPL"
            ]
          },
          "seasons": {
            "title": "Seasons",
            "type": "array",
            "description": "Start year of the season, from 2014 to now: 2026 = 2026/27. You can also write 2025/26 or current. Empty = current season.",
            "items": {
              "type": "string"
            }
          },
          "matchStatus": {
            "title": "Matches to include",
            "enum": [
              "all",
              "results",
              "fixtures"
            ],
            "type": "string",
            "description": "Matches mode only.",
            "default": "all"
          },
          "dateFrom": {
            "title": "From date",
            "type": "string",
            "description": "Optional. Only matches on or after this day (YYYY-MM-DD). Works in matches, team match logs, shots, lineups and player match logs."
          },
          "dateTo": {
            "title": "To date",
            "type": "string",
            "description": "Optional. Only matches on or before this day (YYYY-MM-DD)."
          },
          "lastMatches": {
            "title": "Form table: last N matches",
            "minimum": 0,
            "maximum": 60,
            "type": "integer",
            "description": "Table mode only. 0 = whole season. 5 = a table built from each team's last 5 matches (form).",
            "default": 0
          },
          "minMinutes": {
            "title": "Players: minimum minutes",
            "minimum": 0,
            "type": "integer",
            "description": "Players mode only. Skip players with fewer minutes (per-90 numbers are noisy below ~450).",
            "default": 0
          },
          "matchUrls": {
            "title": "Match links or ids (shots, lineups)",
            "type": "array",
            "description": "Optional. Understat match links like https://understat.com/match/28778 or just 28778. Empty = the most recent played matches of the leagues and seasons above.",
            "items": {
              "type": "string"
            }
          },
          "maxMatches": {
            "title": "Max matches (shots, lineups)",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "When no match links are given: how many of the most recent played matches to read. A full league season is 306 to 380 matches.",
            "default": 50
          },
          "playerUrls": {
            "title": "Player links or ids",
            "type": "array",
            "description": "Player match logs mode. Understat player links or ids. Add seasons above to keep only those seasons; leave seasons empty for the full career on Understat.",
            "items": {
              "type": "string"
            }
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Used for shots, lineups and player match logs.",
            "default": 4
          },
          "proxy": {
            "title": "Proxy (optional)",
            "type": "object",
            "description": "Not needed: the scraper connects directly and falls back to Apify Proxy on its own if Understat slows it down."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}