{
  "openapi": "3.0.1",
  "info": {
    "title": "Wikipedia & Wikidata API — Articles, Search & Pageviews",
    "description": "Wikipedia search, article text (intro or full), descriptions, categories and Wikidata ids; daily human pageviews and a day's top 1,000; Wikidata entities with flattened properties. Any language edition, no API key, no browser. Diagnostics and empty runs are free.",
    "version": "0.1",
    "x-build-id": "f3I0MPZlE8tMwofWV"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/insight.solutions~wikipedia-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-insight.solutions-wikipedia-api",
        "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/insight.solutions~wikipedia-api/runs": {
      "post": {
        "operationId": "runs-sync-insight.solutions-wikipedia-api",
        "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/insight.solutions~wikipedia-api/run-sync": {
      "post": {
        "operationId": "run-sync-insight.solutions-wikipedia-api",
        "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": {
          "language": {
            "title": "Wikipedia language",
            "pattern": "^[a-zA-Z-]{2,12}$",
            "type": "string",
            "description": "The Wikipedia edition to read, as its subdomain: `en`, `de`, `fr`, `es`, `ja`, `zh`, `pt`, `simple` … Every edition works. Used for search, titles, categories, pageviews, the top list and the language of Wikidata labels. A title given as a URL keeps the language of its own URL.",
            "default": "en"
          },
          "queries": {
            "title": "Search queries",
            "type": "array",
            "description": "Full-text Wikipedia searches, one per entry, e.g. `[\"web scraping\"]`. Each hit is one `search-result` row with its snippet, size, word count and last-edit time, up to `maxResults` per query.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "titles": {
            "title": "Article titles or URLs",
            "type": "array",
            "description": "Articles to fetch, as titles (`Web scraping`, `Web_scraping`) or URLs (`https://de.wikipedia.org/wiki/Screen_Scraping`). Each becomes one `article` row. Duplicates and redirects to the same page are fetched and charged once.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Categories whose articles to fetch, e.g. `Category:Web scraping` (the prefix is optional). Only the category's own articles are read — subcategories are not descended into — up to `maxResults` per category, and each becomes an `article` row.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max results per entry",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "The most rows one query, category, top-views day or Wikidata search may return. Searches page 50 at a time, categories 500 at a time.",
            "default": 50
          },
          "articleContent": {
            "title": "Article text",
            "enum": [
              "intro",
              "full",
              "none"
            ],
            "type": "string",
            "description": "`intro` returns the lead section as plain text (titles are fetched twenty per request). `full` returns the whole article as plain text, up to `maxTextChars` (one request per article). `none` returns no article rows at all — use it when you only want search results or pageviews.",
            "default": "intro"
          },
          "fetchArticlesForSearch": {
            "title": "Fetch an article for every search hit",
            "type": "boolean",
            "description": "Also return an `article` row (with the text chosen above) for every search hit. Adds one request per 20 hits for intros, one per hit for full text.",
            "default": false
          },
          "maxTextChars": {
            "title": "Max text characters",
            "minimum": 100,
            "maximum": 1000000,
            "type": "integer",
            "description": "Cap on `text`. A longer article is cut here and marked `textTruncated: true`; `textChars` and `wordCount` still describe the whole extract.",
            "default": 50000
          },
          "includeCategories": {
            "title": "Include categories",
            "type": "boolean",
            "description": "The article's visible categories (up to 50; hidden maintenance categories are excluded). No extra request.",
            "default": true
          },
          "includeSections": {
            "title": "Include section outline",
            "type": "boolean",
            "description": "The table of contents as `sections[] { level, title, anchor, index, number }`. One extra request per article.",
            "default": false
          },
          "includeLinks": {
            "title": "Include links",
            "type": "boolean",
            "description": "The first 500 article links, first 100 external links and the number of pages linking here (first 100). `linksCountIsPartial` is true when any list had more. One extra request per article.",
            "default": false
          },
          "includeRevisions": {
            "title": "Include recent revisions",
            "type": "boolean",
            "description": "The last 20 revisions as `lastRevisions[] { revid, timestamp, comment, size }`. Editor usernames are never read or returned, and names inside edit summaries are replaced with `[editor]`. One extra request per article.",
            "default": false
          },
          "pageviews": {
            "title": "Pageviews",
            "enum": [
              "none",
              "last30",
              "last90",
              "range"
            ],
            "type": "string",
            "description": "Daily pageviews for every article in the run (titles, category members, and search hits when articles are fetched for them): one `pageviews` row per title with the series, total, daily average and peak day. Human traffic only (agent `user`): crawlers and bots are excluded. `last30` and `last90` end yesterday, the newest day the API has.",
            "default": "none"
          },
          "pageviewsFrom": {
            "title": "Pageviews from",
            "type": "string",
            "description": "First day of the `range` window, `YYYYMMDD` or `YYYY-MM-DD`. Data starts on 2015-07-01."
          },
          "pageviewsTo": {
            "title": "Pageviews to",
            "type": "string",
            "description": "Last day of the `range` window, `YYYYMMDD` or `YYYY-MM-DD`."
          },
          "topViews": {
            "title": "Top articles of a day",
            "type": "array",
            "description": "Dates (`YYYY-MM-DD`) whose most-read articles to return: up to 1,000 per day from the pageviews API, one `pageviews` row each with `rank` and `views`, capped by `maxResults`. The main page, `Special:` pages and other non-article pages are left out unless you tick the box below.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keepSpecialPages": {
            "title": "Keep non-article pages in top lists",
            "type": "boolean",
            "description": "Keep `Main_Page`, `Special:Search`, `Wikipedia:`, `File:`, `Portal:` and similar entries in a top list.",
            "default": false
          },
          "wikidataIds": {
            "title": "Wikidata ids",
            "type": "array",
            "description": "Entities to fetch, e.g. `[\"Q42\", \"Q95\"]` or `https://www.wikidata.org/wiki/Q42`. Each becomes one `entity` row with its label, description, aliases, Wikipedia link and the properties below.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "wikidataSearch": {
            "title": "Wikidata search",
            "type": "array",
            "description": "Names to look up on Wikidata, e.g. `[\"Apify\"]`. Up to `maxResults` matching entities per name, each an `entity` row.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "entityProperties": {
            "title": "Entity properties",
            "type": "array",
            "description": "Wikidata properties to flatten into `properties`, as ids (`P31`) or the bundled names (`instanceOf`). Item values come back as `{ id, label }`, dates at their real precision, images and logos as Commons URLs. Contact details (email, phone, address, personal social handles) are never extracted.",
            "default": [
              "P31",
              "P17",
              "P131",
              "P159",
              "P571",
              "P856",
              "P1128",
              "P452",
              "P112",
              "P169",
              "P1454",
              "P625",
              "P18"
            ],
            "items": {
              "type": "string"
            }
          },
          "includeRawClaims": {
            "title": "Include raw claims",
            "type": "boolean",
            "description": "Also return every statement in Wikidata's own JSON as `claimsRaw` (large: Q42 has 354). Contact-detail properties are removed from it too.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Requests in flight at once, across everything the run is doing. Requests also start at least 100 ms apart, so a run never exceeds 10 requests a second.",
            "default": 4
          },
          "maxRunSecs": {
            "title": "Time budget (seconds)",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "Stop after this many seconds. Rows already returned are kept and a free `deadline` row says what was left.",
            "default": 240
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Every Wikimedia endpoint answered from the Apify datacenter proxy (and with no proxy at all), so datacenter is the default and residential buys nothing here.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}