{
  "openapi": "3.0.1",
  "info": {
    "title": "Wikimedia Pageviews & Analytics Scraper",
    "description": "Query the keyless Wikimedia Analytics API (AQS) for any Wikipedia project. Article and project pageviews over time, the top 1000 articles per day/month, views by country, unique devices, Commons media requests, and edit/editor activity. Legacy pagecounts back to 2007. CC0.",
    "version": "0.1",
    "x-build-id": "ZNwwC3VTeHIFdD0Q1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapyx~wikimedia-pageviews-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapyx-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/scrapyx~wikimedia-pageviews-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapyx-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/scrapyx~wikimedia-pageviews-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapyx-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",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "article-pageviews",
              "project-pageviews",
              "top-articles",
              "top-by-country",
              "unique-devices",
              "media-requests",
              "wiki-activity"
            ],
            "type": "string",
            "description": "Which AQS metric family to query. `article-pageviews` = views per article; `project-pageviews` = whole-project totals; `top-articles` = the most-viewed articles for a day/month; `top-by-country` = country breakdown; `unique-devices` = device estimates; `media-requests` = Commons/upload media hits; `wiki-activity` = edits/editors/new pages/new users.",
            "default": "article-pageviews"
          },
          "project": {
            "title": "Project",
            "type": "string",
            "description": "Wikimedia project domain, e.g. `en.wikipedia`, `de.wikipedia`, `commons.wikimedia`, `www.wikidata`. For `project-pageviews` you may also use `all-projects` (not accepted by top-articles / top-by-country).",
            "default": "en.wikipedia"
          },
          "articles": {
            "title": "Articles",
            "type": "array",
            "description": "`article-pageviews` mode. One article title per line — the EXACT title (case-sensitive; spaces or underscores both fine). E.g. `Berlin`, `Python (programming language)`, `AC/DC`.",
            "items": {
              "type": "string"
            }
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "Time-series modes (article / project / unique-devices / media-requests / wiki-activity). `YYYY-MM-DD` or `YYYYMMDD`. Defaults to 30 days ago (180 for wiki-activity). Modern pageview data begins 2015-07-01; earlier project-pageviews windows auto-route to legacy pagecounts (back to 2007-12)."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Time-series modes. `YYYY-MM-DD` or `YYYYMMDD`. Defaults to today. The most recent 1-2 days of pageviews (and several days of edit metrics) may not have landed yet — that returns an empty summary with a note, not an error."
          },
          "granularity": {
            "title": "Granularity",
            "enum": [
              "daily",
              "monthly",
              "hourly"
            ],
            "type": "string",
            "description": "`daily` or `monthly` for every time-series mode; `hourly` additionally for `project-pageviews` and `media-requests`. per-article rejects hourly.",
            "default": "daily"
          },
          "access": {
            "title": "Access method",
            "enum": [
              "all-access",
              "desktop",
              "mobile-web",
              "mobile-app"
            ],
            "type": "string",
            "description": "article / project / top-articles / top-by-country. `all-access`, or split by `desktop` / `mobile-web` / `mobile-app`.",
            "default": "all-access"
          },
          "agent": {
            "title": "Agent type",
            "enum": [
              "all-agents",
              "user",
              "spider",
              "automated"
            ],
            "type": "string",
            "description": "article / project pageviews. `all-agents`, or `user` (exclude bots/crawlers), `spider`, `automated`.",
            "default": "all-agents"
          },
          "dates": {
            "title": "Dates (top-articles)",
            "type": "array",
            "description": "`top-articles` mode. One per line: `YYYY/MM/DD` for a single day, or `YYYY/MM` for the whole-month ranking. Defaults to last month's whole-month ranking. Each date is one request; up to 1000 ranked articles come back.",
            "items": {
              "type": "string"
            }
          },
          "months": {
            "title": "Months (top-by-country)",
            "type": "array",
            "description": "`top-by-country` mode. One `YYYY/MM` per line. Defaults to last month. Views are privacy-bucketed (a range string + a ceiling), never exact.",
            "items": {
              "type": "string"
            }
          },
          "maxTopArticles": {
            "title": "Max top articles per date",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "`top-articles` mode. Trim each day's/month's ranking to the top N (max and default 1000).",
            "default": 1000
          },
          "accessSite": {
            "title": "Access site (unique-devices)",
            "enum": [
              "all-sites",
              "desktop-site",
              "mobile-site"
            ],
            "type": "string",
            "description": "`unique-devices` mode. `all-sites`, `desktop-site` or `mobile-site`.",
            "default": "all-sites"
          },
          "mediaSubMode": {
            "title": "Media sub-mode",
            "enum": [
              "per-file",
              "aggregate"
            ],
            "type": "string",
            "description": "`media-requests` mode. `per-file` = counts for specific files in `files`; `aggregate` = project-wide media requests split by referer / media type.",
            "default": "per-file"
          },
          "files": {
            "title": "Files (media-requests / per-file)",
            "type": "array",
            "description": "`media-requests` per-file. One per line: a Commons file name (`File:Wikipedia-logo-v2.svg` or just `Wikipedia-logo-v2.svg`) — resolved to its hashed upload path automatically — or a ready `/wikipedia/commons/8/80/Wikipedia-logo-v2.svg` path.",
            "items": {
              "type": "string"
            }
          },
          "referer": {
            "title": "Referer (media-requests)",
            "enum": [
              "all-referers",
              "internal",
              "external",
              "search-engine",
              "unknown",
              "none"
            ],
            "type": "string",
            "description": "`media-requests` mode. `all-referers`, `internal`, `external`, `search-engine`, `unknown`, `none`.",
            "default": "all-referers"
          },
          "mediaType": {
            "title": "Media type (media-requests / aggregate)",
            "enum": [
              "all-media-types",
              "image",
              "audio",
              "video",
              "document",
              "other"
            ],
            "type": "string",
            "description": "`media-requests` aggregate sub-mode. `all-media-types`, `image`, `audio`, `video`, `document`, `other`.",
            "default": "all-media-types"
          },
          "activityMetrics": {
            "title": "Activity metrics (wiki-activity)",
            "type": "array",
            "description": "`wiki-activity` mode. Any of: `edits`, `editors`, `new-pages`, `registered-users`. Each is one request. Defaults to edits + editors + new-pages.",
            "items": {
              "type": "string"
            }
          },
          "editorType": {
            "title": "Editor type (wiki-activity)",
            "enum": [
              "all-editor-types",
              "anonymous",
              "group-bot",
              "name-bot",
              "user"
            ],
            "type": "string",
            "description": "`wiki-activity` mode. `all-editor-types`, `anonymous`, `group-bot`, `name-bot`, `user`.",
            "default": "all-editor-types"
          },
          "pageType": {
            "title": "Page type (wiki-activity)",
            "enum": [
              "all-page-types",
              "content",
              "non-content"
            ],
            "type": "string",
            "description": "`wiki-activity` mode. `all-page-types`, `content` (article namespace), `non-content`.",
            "default": "all-page-types"
          },
          "activityLevel": {
            "title": "Activity level (wiki-activity / editors)",
            "enum": [
              "all-activity-levels",
              "1..4-edits",
              "5..24-edits",
              "25..99-edits",
              "100..-edits"
            ],
            "type": "string",
            "description": "`wiki-activity` mode, `editors` metric only. `all-activity-levels`, `1..4-edits`, `5..24-edits`, `25..99-edits`, `100..-edits`.",
            "default": "all-activity-levels"
          },
          "slimOutput": {
            "title": "Slim output (drop raw)",
            "type": "boolean",
            "description": "By default every data row carries the verbatim upstream item in `raw`. Turn on to emit only the normalised fields.",
            "default": false
          },
          "maxResults": {
            "title": "Max data rows",
            "minimum": 1,
            "type": "integer",
            "description": "Global cap on data rows across the whole run (summaries and errors don't count). Default 100,000.",
            "default": 100000
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Parallel in-flight requests (matters for article / top / media / wiki-activity modes with many inputs).",
            "default": 4
          },
          "minRequestInterval": {
            "title": "Min seconds between requests",
            "minimum": 0,
            "type": "number",
            "description": "Politeness pacing for Wikimedia's infrastructure. The AQS is generous but shared.",
            "default": 0.15
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. No anti-bot layer on the AQS, so a proxy is OFF by default.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}