{
  "openapi": "3.0.1",
  "info": {
    "title": "Pokemon Competitive Usage Stats - Smogon",
    "description": "Pokemon competitive usage stats from Smogon: usage rate and rank of every Pokemon, plus its top moves, items, abilities, EV spreads, Tera types, teammates and counters. Any format and month since 2014. No proxy. Export to Excel, CSV or API.",
    "version": "0.1",
    "x-build-id": "mggSZQGAYzoLL1Xhz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pshivam~smogon-pokemon-usage-stats-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pshivam-smogon-pokemon-usage-stats-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/pshivam~smogon-pokemon-usage-stats-scraper/runs": {
      "post": {
        "operationId": "runs-sync-pshivam-smogon-pokemon-usage-stats-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/pshivam~smogon-pokemon-usage-stats-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-pshivam-smogon-pokemon-usage-stats-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": {
          "dataTypes": {
            "title": "What to get",
            "type": "array",
            "description": "Usage: the rank and usage rate of every Pokemon. Details: each Pokemon's most used moves, items, abilities, EV spreads, Tera types, teammates and counters. Leads: how often each Pokemon leads. Playstyles: the share of stall, balance, offense and other team styles. Leave empty for usage.",
            "items": {
              "type": "string",
              "enum": [
                "usage",
                "details",
                "leads",
                "metagame"
              ],
              "enumTitles": [
                "Usage (rank and usage rate of every Pokemon)",
                "Details (moves, items, abilities, spreads, Tera types, teammates, counters)",
                "Leads (how often each Pokemon leads)",
                "Playstyles (stall, balance, offense ...)"
              ]
            }
          },
          "formats": {
            "title": "Formats",
            "type": "array",
            "description": "Smogon format names: gen9ou, gen9uu, gen9ubers, gen9doublesou, gen9championsvgc2026regmc, gen9monotype, gen8ou ... Use the word all for every format of the month. Leave empty for gen9ou.",
            "items": {
              "type": "string"
            }
          },
          "months": {
            "title": "Months",
            "type": "array",
            "description": "latest (the newest month), a month such as 2026-10, a year such as 2025 (all its months) or all (every month since 2014-11). Leave empty for latest.",
            "items": {
              "type": "string"
            }
          },
          "ratingCutoffs": {
            "title": "Rating cutoffs",
            "type": "array",
            "description": "Which ladder ratings count: highest (the strongest players), all, or numbers such as 0, 1500, 1695, 1825. Smogon publishes four cutoffs per format; 0 is every battle. Leave empty for highest.",
            "items": {
              "type": "string"
            }
          },
          "pokemon": {
            "title": "Pokemon",
            "type": "array",
            "description": "Only these Pokemon: a name or the start of a name (Great Tusk, Landorus, Iron). Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "minUsage": {
            "title": "Minimum usage (percent)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Only Pokemon used on at least this percent of teams, for example 5. For lead rows the lead rate counts."
          },
          "detailTypes": {
            "title": "Details to get",
            "type": "array",
            "description": "For the details data type: which lists to return. Leave empty for all of them.",
            "items": {
              "type": "string",
              "enum": [
                "abilities",
                "items",
                "moves",
                "spreads",
                "teraTypes",
                "teammates",
                "counters"
              ],
              "enumTitles": [
                "Abilities",
                "Items",
                "Moves",
                "EV spreads and natures",
                "Tera types",
                "Teammates",
                "Checks and counters"
              ]
            }
          },
          "topPerCategory": {
            "title": "Entries per list",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "For the details data type: how many of the most used moves, items, spreads, teammates ... to return per Pokemon. Teammate and spread lists run to hundreds of entries.",
            "default": 10
          },
          "onlyNew": {
            "title": "Only new or changed records",
            "type": "boolean",
            "description": "Skip records that earlier runs of this same search already returned, so you pay only for the new month. The first run works as usual and remembers what it returned, in your key-value store 'smogon-pokemon-usage-stats-scraper-only-new'.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Stop after this many records. You are charged per record.",
            "default": 5000
          },
          "maxConcurrency": {
            "title": "Max parallel requests",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "Files fetched at the same time. The details files are 1 to 12 MB each.",
            "default": 2
          },
          "secondsBetweenRequests": {
            "title": "Seconds between requests",
            "minimum": 0.1,
            "maximum": 60,
            "type": "number",
            "description": "Pause between requests to Smogon. After a Too Many Requests answer the Actor doubles the pause for the rest of the run.",
            "default": 0.5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}