{
  "openapi": "3.0.1",
  "info": {
    "title": "Wikimedia Pageviews Scraper",
    "description": "Scrape Wikipedia & Wikimedia pageview metrics from the official REST API. Get daily/monthly view counts per article, most-viewed (top) articles for any day or month, and project-wide aggregate traffic - across 40+ languages and sister projects.",
    "version": "1.0",
    "x-build-id": "HjD3171QmDvDusW4H"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~wikimedia-pageviews-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-wikimedia-pageviews-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~wikimedia-pageviews-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-wikimedia-pageviews-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~wikimedia-pageviews-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-wikimedia-pageviews-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",
          "project"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "articlePageviews",
              "topArticles",
              "aggregatePageviews",
              "topArticlesByCountry"
            ],
            "type": "string",
            "description": "What to fetch.",
            "default": "articlePageviews"
          },
          "project": {
            "title": "Wikimedia project",
            "enum": [
              "en.wikipedia",
              "es.wikipedia",
              "de.wikipedia",
              "fr.wikipedia",
              "it.wikipedia",
              "ja.wikipedia",
              "ru.wikipedia",
              "zh.wikipedia",
              "pt.wikipedia",
              "ar.wikipedia",
              "pl.wikipedia",
              "nl.wikipedia",
              "uk.wikipedia",
              "fa.wikipedia",
              "tr.wikipedia",
              "id.wikipedia",
              "ko.wikipedia",
              "sv.wikipedia",
              "vi.wikipedia",
              "he.wikipedia",
              "cs.wikipedia",
              "fi.wikipedia",
              "hi.wikipedia",
              "th.wikipedia",
              "el.wikipedia",
              "hu.wikipedia",
              "ro.wikipedia",
              "da.wikipedia",
              "bn.wikipedia",
              "no.wikipedia",
              "sr.wikipedia",
              "ca.wikipedia",
              "commons.wikimedia",
              "www.wikidata",
              "meta.wikimedia",
              "en.wiktionary",
              "en.wikisource",
              "en.wikiquote",
              "en.wikivoyage",
              "en.wikibooks",
              "en.wikinews"
            ],
            "type": "string",
            "description": "The wiki to query, e.g. `en.wikipedia` for English Wikipedia.",
            "default": "en.wikipedia"
          },
          "articles": {
            "title": "Articles (mode=articlePageviews)",
            "type": "array",
            "description": "Article titles or full wiki URLs, e.g. `Albert Einstein` or `https://en.wikipedia.org/wiki/Albert_Einstein`. Spaces are converted to underscores automatically.",
            "default": [
              "Albert Einstein"
            ],
            "items": {
              "type": "string"
            }
          },
          "access": {
            "title": "Access method",
            "enum": [
              "all-access",
              "desktop",
              "mobile-app",
              "mobile-web"
            ],
            "type": "string",
            "description": "Which platform's traffic to count.",
            "default": "all-access"
          },
          "agent": {
            "title": "Agent type",
            "enum": [
              "user",
              "all-agents",
              "spider",
              "automated"
            ],
            "type": "string",
            "description": "Traffic source. `user` excludes bots/crawlers. Used by per-article and aggregate modes.",
            "default": "user"
          },
          "granularity": {
            "title": "Granularity",
            "enum": [
              "daily",
              "monthly"
            ],
            "type": "string",
            "description": "Time bucket for per-article and aggregate modes.",
            "default": "monthly"
          },
          "startDate": {
            "title": "Start date (mode=articlePageviews / aggregatePageviews)",
            "type": "string",
            "description": "Range start, format `YYYYMMDD` (or `YYYY-MM-DD`). Data begins 2015-07-01.",
            "default": "20240101"
          },
          "endDate": {
            "title": "End date (mode=articlePageviews / aggregatePageviews)",
            "type": "string",
            "description": "Range end, format `YYYYMMDD` (or `YYYY-MM-DD`).",
            "default": "20240301"
          },
          "topYear": {
            "title": "Top: year (mode=topArticles)",
            "minimum": 2015,
            "maximum": 2100,
            "type": "integer",
            "description": "Year to rank the most-viewed articles for.",
            "default": 2024
          },
          "topMonth": {
            "title": "Top: month (mode=topArticles)",
            "enum": [
              "01",
              "02",
              "03",
              "04",
              "05",
              "06",
              "07",
              "08",
              "09",
              "10",
              "11",
              "12"
            ],
            "type": "string",
            "description": "Month (01-12) to rank the most-viewed articles for.",
            "default": "01"
          },
          "topDay": {
            "title": "Top: day (mode=topArticles)",
            "enum": [
              "all-days",
              "01",
              "02",
              "03",
              "04",
              "05",
              "06",
              "07",
              "08",
              "09",
              "10",
              "11",
              "12",
              "13",
              "14",
              "15",
              "16",
              "17",
              "18",
              "19",
              "20",
              "21",
              "22",
              "23",
              "24",
              "25",
              "26",
              "27",
              "28",
              "29",
              "30",
              "31"
            ],
            "type": "string",
            "description": "Day of month (01-31) to rank, or `all-days` for the whole-month ranking.",
            "default": "all-days"
          },
          "country": {
            "title": "Country (mode=topArticlesByCountry)",
            "enum": [
              "US",
              "GB",
              "CA",
              "AU",
              "IN",
              "DE",
              "FR",
              "IT",
              "ES",
              "NL",
              "PL",
              "RU",
              "UA",
              "BR",
              "MX",
              "JP",
              "KR",
              "CN",
              "TW",
              "HK",
              "ID",
              "TR",
              "IR",
              "SA",
              "EG",
              "IL",
              "SE",
              "NO",
              "DK",
              "FI",
              "BE",
              "AT",
              "CH",
              "PT",
              "GR",
              "CZ",
              "RO",
              "HU",
              "TH",
              "VN",
              "PH",
              "MY",
              "SG",
              "AR",
              "CL",
              "CO",
              "ZA",
              "NG",
              "PK",
              "BD"
            ],
            "type": "string",
            "description": "ISO 3166-1 alpha-2 country code to rank the most-viewed articles for. This mode ranks daily and across all projects, so set `topDay` to a specific day (a whole-month ranking is not available).",
            "default": "US"
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard cap on emitted records.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}