{
  "openapi": "3.0.1",
  "info": {
    "title": "Wikipedia Pageviews Scraper - Daily Views, Spikes, Top Articles",
    "description": "Daily Wikipedia pageviews for any article, in any language: views per day, change from the previous day and ratio to the 7-day average. Get one row per day or a summary, the most viewed articles of a day, or monitor articles and get only new days or only spikes.",
    "version": "0.1",
    "x-build-id": "d8Jz294EAdeTUUObI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/neverempty~wikipedia-pageviews-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-neverempty-wikipedia-pageviews-tracker",
        "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/neverempty~wikipedia-pageviews-tracker/runs": {
      "post": {
        "operationId": "runs-sync-neverempty-wikipedia-pageviews-tracker",
        "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/neverempty~wikipedia-pageviews-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-neverempty-wikipedia-pageviews-tracker",
        "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": {
          "articles": {
            "title": "Wikipedia articles (titles or URLs)",
            "type": "array",
            "description": "Pasting the article URL is the surest way to name an article, for example `https://de.wikipedia.org/wiki/Berlin` (a URL carries its own language edition). Titles such as `Taylor Swift` also work, but Wikipedia counts a redirect or alternate name (for example `Einstein`) separately from the article it points to (`Albert Einstein`), and titles are case-sensitive after the first letter. For a typed title the Actor also tries the form with every word capitalised and keeps the one with more views (see `resolvedTitle`).",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "title": "Language edition for titles",
            "type": "string",
            "description": "Wikipedia language code used for entries given as plain titles: `en`, `de`, `fr`, `es`, `ja`, `zh`, `simple` and so on. Entries given as URLs use the language in the URL.",
            "default": "en"
          },
          "days": {
            "title": "Days of history",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "How many days to return, ending yesterday (UTC) or at \"End date\". Ignored when \"Start date\" is set. Daily pageviews exist from 2015-07-01. One run returns up to 300 days of daily rows per article, or up to 3650 days as one summary row.",
            "default": 30
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "First day to return (UTC, YYYY-MM-DD). Leave empty to use \"Days of history\"."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Last day to return (UTC, YYYY-MM-DD). Leave empty for yesterday: Wikimedia publishes each UTC day once, during the following day, so today is never available."
          },
          "output": {
            "title": "Output",
            "enum": [
              "daily",
              "summary"
            ],
            "type": "string",
            "description": "`daily` returns one row per article per day with views, change from the previous day and ratio to the average of the 7 days before. `summary` returns one row per article with total, daily average, peak day, latest day, and last 7 days against the 7 days before. Either way an article is one charged result.",
            "default": "daily"
          },
          "spikeMultiplier": {
            "title": "Spike threshold (times the 7-day average)",
            "type": "string",
            "description": "For example `2` marks a day as a spike when its views are at least twice the average of the 7 days before it (`isSpike`). In monitoring mode, setting this returns only the spike days. Leave empty for no spike detection."
          },
          "spikeMinViews": {
            "title": "Minimum views for a spike",
            "minimum": 0,
            "type": "integer",
            "description": "A day counts as a spike only if it also has at least this many views. Keeps tiny articles (3 views against an average of 1) out of the alerts."
          },
          "monitoringMode": {
            "title": "Monitoring mode (only new days / only spikes)",
            "type": "boolean",
            "description": "Run the same articles on a schedule and get only the days Wikimedia has published since the previous run, or, with a spike threshold, only the new days that are spikes. The first run saves the starting point, returns no day rows and is not charged. After that, articles with nothing to return are charged the small check event instead of a result.",
            "default": false
          },
          "watchName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Optional. Keeps a separate memory for this name, so two schedules watching the same article do not share a starting point."
          },
          "resetMonitoringState": {
            "title": "Reset monitoring memory",
            "type": "boolean",
            "description": "Forget the saved starting point for the articles in this run and save a new one.",
            "default": false
          },
          "topLanguages": {
            "title": "Most viewed articles: language editions",
            "type": "array",
            "description": "Language codes such as `en`, `de`, `ja`. For each one the run returns the most viewed articles of one day, ranked, as Wikimedia publishes them (the list includes the main page and special pages). One list is one charged result.",
            "items": {
              "type": "string"
            }
          },
          "topDate": {
            "title": "Most viewed articles: day",
            "type": "string",
            "description": "The UTC day of the list (YYYY-MM-DD). Leave empty for the latest published day (yesterday, or the day before if yesterday is not published yet)."
          },
          "topLimit": {
            "title": "Most viewed articles: rows per list",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "How many ranked articles to return per list, up to 300.",
            "default": 100
          },
          "access": {
            "title": "Platform",
            "enum": [
              "all-access",
              "desktop",
              "mobile-web",
              "mobile-app"
            ],
            "type": "string",
            "description": "Which readers to count.",
            "default": "all-access"
          },
          "agent": {
            "title": "Traffic type",
            "enum": [
              "user",
              "all-agents",
              "automated",
              "spider"
            ],
            "type": "string",
            "description": "Which traffic class to count for articles, as classified by Wikimedia. The most-viewed lists are published by Wikimedia for one fixed traffic class and ignore this setting.",
            "default": "user"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}