{
  "openapi": "3.0.1",
  "info": {
    "title": "ESPN Cricinfo Scraper",
    "description": "Extract cricket statistics and records from ESPNcricinfo — the definitive cricket database. Search players, pull career stats, team records, venue profiles, and full match scorecards, as clean structured JSON/CSV/Excel.",
    "version": "0.0",
    "x-build-id": "av8yZ3289tcH1nD65"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapix~espncricinfo-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapix-espncricinfo-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/scrapix~espncricinfo-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapix-espncricinfo-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/scrapix~espncricinfo-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapix-espncricinfo-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 scrape",
            "enum": [
              "searchPlayers",
              "playerStats",
              "teamStats",
              "venueStats",
              "matchScorecard"
            ],
            "type": "string",
            "description": "Choose the operation. 'Search players' resolves names to ESPNcricinfo player IDs. 'Player stats' fetches career stats for player IDs (use Search players first to find them). 'Team stats' fetches each team's results record per format. 'Venue stats' fetches each ground's profile per format. 'Match scorecard' fetches full scorecards for match IDs.",
            "default": "searchPlayers"
          },
          "playerNames": {
            "title": "Player names (Search players mode)",
            "type": "array",
            "description": "Player names (or partial names) to search, e.g. \"Sachin Tendulkar\", \"Kohli\". One result set per name; every matching player is returned with their cricinfo player ID.",
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerName": {
            "title": "Max results per name (Search players mode)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Stop after collecting this many matching players per name. Common names (e.g. \"Sachin\") can match 100+ players.",
            "default": 50
          },
          "playerIds": {
            "title": "Player IDs (Player stats mode)",
            "type": "array",
            "description": "ESPNcricinfo player IDs to fetch career stats for, e.g. \"253802\" (Virat Kohli). Get these from the 'Search players' mode.",
            "items": {
              "type": "string"
            }
          },
          "teams": {
            "title": "Teams (Team stats mode)",
            "type": "array",
            "description": "Teams to return records for. International teams by name (e.g. \"India\", \"West Indies\"); IPL franchises by name or abbreviation (e.g. \"Mumbai Indians\", \"RCB\"). Leave empty to return every team for the chosen formats.",
            "items": {
              "type": "string"
            }
          },
          "venues": {
            "title": "Venues (Venue stats mode)",
            "type": "array",
            "description": "Ground/stadium names to return profiles for, e.g. \"Eden Gardens\", \"Wankhede\", \"Melbourne Cricket Ground\". Partial names work. Leave empty to return the busiest venues for the chosen formats.",
            "items": {
              "type": "string"
            }
          },
          "maxVenuePages": {
            "title": "Max venue pages to scan (Venue stats mode)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "When searching for named venues, how many pages (~50 grounds each, ordered by matches hosted) to scan before giving up. Higher finds lesser-used grounds at the cost of more requests.",
            "default": 10
          },
          "matchIds": {
            "title": "Match IDs (Match scorecard mode)",
            "type": "array",
            "description": "ESPNcricinfo match IDs to fetch full scorecards for, e.g. \"1144530\" (2019 World Cup final). The match ID is the number in a scorecard URL.",
            "items": {
              "type": "string"
            }
          },
          "formats": {
            "title": "Formats (Player, Team & Venue stats modes)",
            "type": "array",
            "description": "Which formats/competitions to return stats for.",
            "items": {
              "type": "string",
              "enum": [
                "test",
                "odi",
                "t20i",
                "ipl"
              ],
              "enumTitles": [
                "Test",
                "ODI",
                "T20I",
                "IPL"
              ]
            },
            "default": [
              "test",
              "odi",
              "t20i",
              "ipl"
            ]
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. ESPNcricinfo rate-limits datacenter IPs; a proxy (Apify Proxy) is recommended for reliable runs.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}