{
  "openapi": "3.0.1",
  "info": {
    "title": "Wikipedia Pageviews API: Trends, Spikes, Daily Views",
    "description": "Daily Wikipedia pageviews per article and language, 0-100 interest index to compare topics, trending articles and spike alerts. Google Trends alternative on official Wikimedia data. No API key, no login. MCP-ready for AI agents. Pay per result, errors free. $0.20 per 1,000 series.",
    "version": "0.1",
    "x-build-id": "LCRtHME2r4ZZzc40Z"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/actose~wikipedia-pageviews-trends/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-actose-wikipedia-pageviews-trends",
        "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/actose~wikipedia-pageviews-trends/runs": {
      "post": {
        "operationId": "runs-sync-actose-wikipedia-pageviews-trends",
        "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/actose~wikipedia-pageviews-trends/run-sync": {
      "post": {
        "operationId": "run-sync-actose-wikipedia-pageviews-trends",
        "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": [
              "series",
              "trending",
              "alerts"
            ],
            "type": "string",
            "description": "<b>series</b>: one pageview series per article and language, with a 0-100 interest index to compare them. <b>trending</b>: most-viewed articles of a wiki on the latest day, with growth vs previous days. <b>alerts</b>: only the articles whose views spiked in the last days (ideal for scheduled runs).",
            "default": "series"
          },
          "articles": {
            "title": "Articles",
            "type": "array",
            "description": "Article titles (\"ChatGPT\"), titles with a language prefix (\"fr:Emmanuel Macron\") or full URLs (https://de.wikipedia.org/wiki/Berlin). Redirects and spelling variants are resolved automatically. Used by the series and alerts modes.",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "title": "Default language",
            "type": "string",
            "description": "Wiki language code used for titles without a prefix (en, fr, de, es, ja, zh, ru...). In trending mode, the wiki to rank.",
            "default": "en"
          },
          "languages": {
            "title": "Also fetch in these languages",
            "type": "array",
            "description": "Optional. Series/alerts: the same article is also fetched in these languages via Wikipedia's interlanguage links (e.g. [\"fr\", \"de\", \"ja\"]) to compare interest by country. Trending: list of wikis to rank (replaces the default language).",
            "items": {
              "type": "string"
            }
          },
          "lastDays": {
            "title": "Last N days",
            "minimum": 1,
            "maximum": 4000,
            "type": "integer",
            "description": "Length of the period ending yesterday (data starts on 2015-07-01). Ignored if a start date is set. Alerts mode always reads at least 30 days to compute the baseline.",
            "default": 90
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "Optional. Start of the period (YYYY-MM-DD)."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Optional. End of the period (YYYY-MM-DD). Default: yesterday (latest published day)."
          },
          "granularity": {
            "title": "Granularity",
            "enum": [
              "daily",
              "monthly"
            ],
            "type": "string",
            "description": "Daily or monthly totals (series and alerts modes).",
            "default": "daily"
          },
          "agent": {
            "title": "Traffic type",
            "enum": [
              "user",
              "all-agents",
              "automated",
              "spider"
            ],
            "type": "string",
            "description": "<b>user</b> = humans only (recommended, bots excluded). all-agents, automated or spider for other traffic.",
            "default": "user"
          },
          "access": {
            "title": "Platform",
            "enum": [
              "all-access",
              "desktop",
              "mobile-web",
              "mobile-app"
            ],
            "type": "string",
            "description": "Count views from all platforms or only desktop, mobile web or mobile app.",
            "default": "all-access"
          },
          "project": {
            "title": "Wikimedia project",
            "enum": [
              "wikipedia",
              "wiktionary",
              "wikiquote",
              "wikinews",
              "wikivoyage",
              "wikibooks",
              "wikisource",
              "wikiversity"
            ],
            "type": "string",
            "description": "Wikipedia by default. Other Wikimedia wikis are supported too.",
            "default": "wikipedia"
          },
          "includeDailyViews": {
            "title": "Include the full daily series",
            "type": "boolean",
            "description": "Keep the dailyViews array (date, views, interestIndex) in each result. Turn off for summary-only results.",
            "default": true
          },
          "spikeMultiplier": {
            "title": "Spike threshold (x baseline)",
            "minimum": 2,
            "maximum": 100,
            "type": "integer",
            "description": "A day is a spike when its views are at least this many times the median of the previous 14 days.",
            "default": 3
          },
          "minSpikeViews": {
            "title": "Minimum views for a spike",
            "minimum": 0,
            "type": "integer",
            "description": "Ignore spikes below this daily view count (filters noise on small articles).",
            "default": 1000
          },
          "alertLookbackDays": {
            "title": "Alert window (latest days)",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "A series is 'spiking now' when a spike happened in this many latest days. Alerts mode only returns those.",
            "default": 2
          },
          "topN": {
            "title": "Number of trending articles per wiki",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "How many of the most-viewed articles to return per wiki (main page and special pages excluded).",
            "default": 50
          },
          "trendingCompareDays": {
            "title": "Compare with previous days",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Growth is computed against the average of this many previous days.",
            "default": 7
          },
          "trendingDate": {
            "title": "Trending date",
            "type": "string",
            "description": "Optional. Day to rank (YYYY-MM-DD). Default: latest published day."
          },
          "sortBy": {
            "title": "Sort trending by",
            "enum": [
              "views",
              "growth"
            ],
            "type": "string",
            "description": "Sort by views (rank) or by growth vs the previous days (breakout topics first).",
            "default": "views"
          },
          "onlySpikes": {
            "title": "Only spiking trending articles",
            "type": "boolean",
            "description": "Trending mode: keep only articles whose views jumped above the spike threshold.",
            "default": false
          },
          "onlyNew": {
            "title": "Only new since last run",
            "type": "boolean",
            "description": "Alerts: skip spikes already returned by a previous run. Trending: skip articles already returned in the last 30 days. State is kept in a named key-value store.",
            "default": false
          },
          "stateName": {
            "title": "State name (optional)",
            "type": "string",
            "description": "Optional label to keep several independent 'only new' memories (e.g. one per client). Default: derived from the input."
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Upper limit of series delivered (and charged) in this run.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}