{
  "openapi": "3.0.1",
  "info": {
    "title": "Tennis Rankings Scraper — ATP & WTA Rankings",
    "description": "Get current ATP and WTA tennis rankings as one row per player: rank, points, weekly rank change, country, age. WTA doubles and past-week history, filters by country, name or rank, agent-ready summary. HTTP-only, MCP-ready.",
    "version": "1.0",
    "x-build-id": "8heAFSAicNBdfud9l"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~tennis-rankings-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-tennis-rankings-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/khadinakbar~tennis-rankings-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-tennis-rankings-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/khadinakbar~tennis-rankings-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-tennis-rankings-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": {
          "tours": {
            "title": "Tours",
            "type": "array",
            "description": "Which tours to return. Use 'atp' for men's rankings, 'wta' for women's rankings, or both. Default: both.",
            "items": {
              "type": "string",
              "enum": [
                "atp",
                "wta"
              ],
              "enumTitles": [
                "ATP (men)",
                "WTA (women)"
              ]
            },
            "default": [
              "atp",
              "wta"
            ]
          },
          "rankingType": {
            "title": "Ranking type",
            "enum": [
              "singles",
              "doubles"
            ],
            "type": "string",
            "description": "'singles' (default, ATP and WTA) or 'doubles' (WTA only). ATP doubles are not available; an ATP request with doubles is skipped with a warning.",
            "default": "singles"
          },
          "rankingDate": {
            "title": "Ranking date (WTA history)",
            "type": "string",
            "description": "Optional past date as YYYY-MM-DD, for example 2025-01-06. Returns the WTA ranking published that week (the date snaps to that week's Monday). Leave empty for the current ranking. Not available for ATP."
          },
          "maxResultsPerTour": {
            "title": "Max players per tour",
            "minimum": 1,
            "maximum": 150,
            "type": "integer",
            "description": "Most player rows to return per tour, in rank order (1 = world No. 1). Applies after filters. Default 100, maximum 150. Lower it to pay for fewer rows.",
            "default": 100
          },
          "maxResults": {
            "title": "Max total results",
            "minimum": 1,
            "type": "integer",
            "description": "Most player rows for the whole run across all tours. Each row is billed once. Default 200. Works as your cost ceiling.",
            "default": 200
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Optional filter. Keep only players from these countries. Use 3-letter codes such as USA, ESP, ITA, or full names such as Italy. Leave empty for all countries.",
            "items": {
              "type": "string"
            }
          },
          "playerNames": {
            "title": "Player names",
            "type": "array",
            "description": "Optional filter. Keep only players whose name contains any of these words, for example Sinner or Swiatek. Accents and capital letters are ignored.",
            "items": {
              "type": "string"
            }
          },
          "minRank": {
            "title": "Best rank to include",
            "minimum": 1,
            "maximum": 150,
            "type": "integer",
            "description": "Optional. Skip players ranked better than this number. For example 11 starts the list at rank 11."
          },
          "maxRank": {
            "title": "Worst rank to include",
            "minimum": 1,
            "maximum": 150,
            "type": "integer",
            "description": "Optional. Skip players ranked worse than this number. For example 20 keeps ranks 1 to 20."
          },
          "onlyMovers": {
            "title": "Only players who moved",
            "type": "boolean",
            "description": "Keep only players whose rank changed since the previous ranking. Good for weekly 'who moved' reports.",
            "default": false
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "rank",
              "points",
              "movement"
            ],
            "type": "string",
            "description": "Row order: 'rank' (default, best first), 'points' (most points first) or 'movement' (biggest risers first).",
            "default": "rank"
          },
          "includeAthleteDetails": {
            "title": "Include player details",
            "type": "boolean",
            "description": "Add age, birthplace, photo URL and player page URL to each row where available. Turn off for lean rows. Default on.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional proxy. The ranking data is public and normally needs no proxy; set one only if you see blocks."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}