{
  "openapi": "3.0.1",
  "info": {
    "title": "ProCyclingStats Scraper",
    "description": "Scrape ProCyclingStats.com - professional road cycling race results, rider profiles, team rosters, and PCS/UCI rankings. No login or API key required.",
    "version": "1.0",
    "x-build-id": "h5OV7D8kpShgILCCe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~procyclingstats-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-procyclingstats-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/crawlerbros~procyclingstats-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-procyclingstats-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/crawlerbros~procyclingstats-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-procyclingstats-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": [
              "raceResults",
              "riderProfile",
              "teamRoster",
              "rankings",
              "raceStartlist"
            ],
            "type": "string",
            "description": "What to fetch from ProCyclingStats.",
            "default": "raceResults"
          },
          "raceSlug": {
            "title": "Race slug (mode=raceResults, raceStartlist)",
            "type": "string",
            "description": "Race URL slug, e.g. `tour-de-france`, `milano-sanremo`, `giro-d-italia`. Find it in the race's ProCyclingStats URL.",
            "default": "tour-de-france"
          },
          "raceYear": {
            "title": "Race year (mode=raceResults, raceStartlist)",
            "minimum": 1900,
            "maximum": 2100,
            "type": "integer",
            "description": "Season year of the race.",
            "default": 2024
          },
          "raceStage": {
            "title": "Stage / result page (mode=raceResults)",
            "type": "string",
            "description": "Which result page to scrape: `stage-1`, `stage-2`, ... for stage races, `prologue`, `gc` (general classification), or `result` for one-day races.",
            "default": "stage-1"
          },
          "riderSlugs": {
            "title": "Rider slugs (mode=riderProfile)",
            "type": "array",
            "description": "Rider URL slugs, e.g. `tadej-pogacar`, `jonas-vingegaard`. Full rider URLs are also accepted.",
            "items": {
              "type": "string"
            }
          },
          "teamSlugs": {
            "title": "Team slugs (mode=teamRoster)",
            "type": "array",
            "description": "Team URL slugs including season year, e.g. `uae-team-emirates-2024`. Full team URLs are also accepted.",
            "items": {
              "type": "string"
            }
          },
          "rankingType": {
            "title": "Ranking type (mode=rankings)",
            "enum": [
              "individual",
              "teams",
              "nations",
              "races",
              "all-time",
              "season-individual",
              "season-teams",
              "season-nations",
              "distance",
              "racedays",
              "climbers",
              "hills",
              "gc-ranking",
              "one-day-races",
              "sprinters",
              "time-trial",
              "uci-individual-daily",
              "uci-teams",
              "u23",
              "u23-nations",
              "team-total",
              "wins-individual",
              "wins-individual-pro",
              "wins-teams",
              "wins-nations",
              "uci-individual",
              "uci-one-day-races",
              "uci-season-individual",
              "uci-nations-olympic-selection",
              "prologues",
              "individual-wins",
              "nation-wins",
              "promotion-relegation",
              "team-wins",
              "world-ranking",
              "wwt"
            ],
            "type": "string",
            "description": "Which PCS/UCI ranking table to fetch. Available options depend on `rankingCategory` — an unsupported combination automatically falls back to `individual` (logged in the run).",
            "default": "individual"
          },
          "rankingCategory": {
            "title": "Rider/team category (mode=rankings)",
            "enum": [
              "me",
              "we"
            ],
            "type": "string",
            "description": "Category group for the ranking table. Only men elite and women elite are exposed — PCS uses an inconsistent, largely unverifiable ranking-type taxonomy for junior and national-team categories.",
            "default": "me"
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Maximum number of records to return.",
            "default": 30
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "ProCyclingStats blocks direct requests from Apify's datacenter IP ranges. The free Apify AUTO proxy group resolves this transparently — leave this on the default.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}