{
  "openapi": "3.0.1",
  "info": {
    "title": "ProCyclingStats Scraper: Results & Riders",
    "description": "Scrape ProCyclingStats race and stage results (rank, rider, team, age, UCI and PCS points, time), rider profiles with specialty points and the PCS world ranking. Export CSV, Excel, JSON or XML. No login or API key. Cloudflare handled with residential proxy.",
    "version": "0.1",
    "x-build-id": "KPXjLjLySk1Wfb89v"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/recordsdata~procyclingstats-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-recordsdata-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/recordsdata~procyclingstats-scraper/runs": {
      "post": {
        "operationId": "runs-sync-recordsdata-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/recordsdata~procyclingstats-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-recordsdata-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",
        "properties": {
          "raceName": {
            "title": "Race name",
            "type": "string",
            "description": "Name of the race, for example Paris-Roubaix, Tour de France, Giro d'Italia or Liège-Bastogne-Liège. Works together with Season below. Leave empty if you paste race URLs or use the Teams, Riders or Rankings blocks."
          },
          "year": {
            "title": "Season (year)",
            "minimum": 1903,
            "maximum": 2100,
            "type": "integer",
            "description": "Season of the race or team, for example 2025. Leave empty for the latest edition that has results."
          },
          "raceContent": {
            "title": "What to return: results or startlist",
            "enum": [
              "results",
              "startlist"
            ],
            "type": "string",
            "description": "Results = who finished where. Startlist = the riders entered in the race with team and bib number, before or after the race.",
            "default": "results"
          },
          "resultScope": {
            "title": "How much of the race (result scope)",
            "enum": [
              "winnersOnly",
              "finalClassification",
              "stageWinners",
              "allStages"
            ],
            "type": "string",
            "description": "Winner only = 1 row per race. Final classification = full finishing order (or final general classification of a stage race). Stage winners = 1 row per stage. All stages = full result of every stage.",
            "default": "finalClassification"
          },
          "classification": {
            "title": "Stage-race classification (stage races only)",
            "enum": [
              "gc",
              "points",
              "kom",
              "youth"
            ],
            "type": "string",
            "description": "Which final classification to return for a stage race: general (GC), points, mountains or youth. One-day races ignore it. Only used with Winner only or Final classification.",
            "default": "gc"
          },
          "stage": {
            "title": "Single stage number (0 = off)",
            "minimum": 0,
            "maximum": 40,
            "type": "integer",
            "description": "Return one stage of a stage race, for example 21 for the last stage of the Tour de France. 0 means off and the scope above decides. One-day races ignore it.",
            "default": 0
          },
          "raceUrls": {
            "title": "Race page URLs (alternative to race name)",
            "type": "array",
            "description": "One ProCyclingStats URL per line. A result, stage, final classification or startlist page works, for example procyclingstats.com/race/tour-de-france/2025/stage-21. A race page without a page name follows the scope above. Team, rider and ranking URLs are also accepted.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "teamUrls": {
            "title": "Teams (URLs, slugs or names)",
            "type": "array",
            "description": "One rider per row with current PCS rank, career points, age and specialty. Example: uae-team-emirates-xrg-2025 or the team name. The Season field above picks the year (default: current).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "riderUrls": {
            "title": "Riders (URLs, slugs or names)",
            "type": "array",
            "description": "Profile with nationality, birth date, height, weight, specialty points and PCS rank. Example: tadej-pogacar or Wout van Aert. Unknown riders return one free error row.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "rankingType": {
            "title": "Ranking table",
            "enum": [
              "none",
              "pcs-individual",
              "pcs-teams",
              "pcs-nations",
              "uci-individual",
              "uci-teams",
              "women-pcs-individual",
              "women-uci-individual"
            ],
            "type": "string",
            "description": "Which PCS or UCI ranking to return. Rider tables list 100 riders per page and the actor reads as many pages as Max ranking rows needs. Team and nation tables come whole.",
            "default": "none"
          },
          "rankingNation": {
            "title": "Nation filter (2-letter code, optional)",
            "type": "string",
            "description": "Keep only riders of one nation in a rider ranking, with the PCS code, for example be, fr, co or us. Leave empty for all nations.",
            "default": ""
          },
          "maxRankingRows": {
            "title": "Max ranking rows (1 to 2500)",
            "minimum": 1,
            "maximum": 2500,
            "type": "integer",
            "description": "How many ranking positions to keep, for example 100 for a top 100.",
            "default": 100
          },
          "includeRankings": {
            "title": "Legacy switch: PCS rider ranking",
            "type": "boolean",
            "description": "Kept for old integrations only. Same as choosing 'PCS ranking: riders' above. Use Ranking table for new runs.",
            "default": false
          },
          "maxItems": {
            "title": "Max rows (free plan: 10)",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum rows returned in total. Free users are limited to 10 rows (preview); paid users up to 1,000,000.",
            "default": 10
          },
          "proxyConfiguration": {
            "title": "Proxy (default: residential)",
            "type": "object",
            "description": "ProCyclingStats sits behind Cloudflare, so Apify RESIDENTIAL proxy is on by default because it is the most reliable. Datacenter proxy also worked in tests but is challenged more often.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}