{
  "openapi": "3.0.1",
  "info": {
    "title": "Wikipedia Scraper · Articles, Extracts, Categories & Links",
    "description": "Extract Wikipedia articles, full text, lead summaries, categories, internal links, page views, and metadata across languages. HTTP-only Wikipedia API scraper for research, LLM datasets, and knowledge graphs.",
    "version": "1.0",
    "x-build-id": "BUQZJghXJdjBdhU9u"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/reapx~wikipedia-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-reapx-wikipedia-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/reapx~wikipedia-scraper/runs": {
      "post": {
        "operationId": "runs-sync-reapx-wikipedia-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/reapx~wikipedia-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-reapx-wikipedia-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": [
          "searchTerms",
          "language",
          "maxArticles"
        ],
        "properties": {
          "searchTerms": {
            "title": "Search Terms / Topics",
            "type": "array",
            "description": "One search query per line. Each is run against Wikipedia's own search index (e.g. <code>Artificial intelligence</code>), and results from every term are merged and de-duplicated by page id.<br><br><b>Empty value:</b> leave empty when you are using <b>Wikipedia Category</b> instead; with neither set the Actor searches <code>Artificial intelligence</code>.<br><br><b>Consequence:</b> more terms means more requests and more rows, and you pay per row returned."
          },
          "category": {
            "title": "Wikipedia Category",
            "type": "string",
            "description": "Extract the members of one Wikipedia category, with or without the prefix (e.g. <code>Category:Machine learning</code> or <code>Machine learning</code>). Category members are collected first, then search terms top the run up to your limit.<br><br><b>Empty value:</b> leave empty to run search terms only.<br><br><b>Consequence:</b> a category walks the category listing 500 pages per request, which is cheaper per row than search."
          },
          "language": {
            "title": "Wikipedia Language",
            "pattern": "^[a-z]{2,3}(-[a-z]{2,8})?$",
            "type": "string",
            "description": "Language edition to read, as the subdomain code (e.g. <code>en</code>, <code>de</code>, <code>fr</code>, <code>es</code>, <code>ja</code>, <code>ar</code>). The Actor calls <code>https://&lt;code&gt;.wikipedia.org/w/api.php</code>, so any edition that exists is reachable.<br><br><b>Empty value:</b> falls back to <code>en</code>.<br><br><b>Consequence:</b> the language also lands on every row, so multi-language corpora stay separable."
          },
          "namespace": {
            "title": "Namespace Filter",
            "enum": [
              "",
              "0",
              "4",
              "6",
              "10",
              "14",
              "100"
            ],
            "type": "string",
            "description": "Restrict results to one MediaWiki namespace id (e.g. <code>0</code> for articles, <code>14</code> for category pages, <code>100</code> for portals).<br><br><b>Empty value:</b> leave empty to accept the API's own default, which is the article namespace for search.<br><br><b>Consequence:</b> a non-article namespace returns pages whose <code>length</code> and <code>extract</code> look nothing like an encyclopedia article, so keep it empty unless you want those."
          },
          "searchSort": {
            "title": "Search Result Order",
            "enum": [
              "",
              "relevance",
              "last_edit_desc",
              "create_timestamp_desc",
              "incoming_links_desc",
              "random"
            ],
            "type": "string",
            "description": "Order Wikipedia's search index returns matches in. <code>relevance</code> is the search default; <code>last_edit_desc</code> gives you the most recently edited matches, <code>incoming_links_desc</code> the most linked-to, <code>create_timestamp_desc</code> the newest pages.<br><br><b>Empty value:</b> leave empty for the API's own relevance order.<br><br><b>Consequence:</b> ordering changes which rows you get when your limit is smaller than the match count, not how many you are charged for. Applies to search terms only, never to a category."
          },
          "maxArticles": {
            "title": "Maximum Articles",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Hard cap on rows for the run, across every search term and the category together (1 to 500).<br><br><b>Empty value:</b> falls back to <code>50</code>.<br><br><b>Consequence:</b> this is your cost cap as well as your row cap - one <code>article-returned</code> event is charged per row, so 500 articles is 500 events. Identity is collected 50 pages per search request and the text is filled in 20 pages per request, so a larger cap costs proportionally more requests too."
          },
          "includeExtract": {
            "title": "Include Lead Extract",
            "type": "boolean",
            "description": "Return the article's plain-text lead section in <code>extract</code>. Text is requested 20 pages per call, which is MediaWiki's <code>exlimit</code> ceiling, so every row carries its extract and not just the first one.<br><br><b>Turned off:</b> <code>extract</code> is an empty string and the run makes fewer, smaller requests.<br><br><b>Consequence:</b> extracts dominate the size of each row, not the price - you are charged per row either way."
          },
          "extractScope": {
            "title": "Extract Scope",
            "enum": [
              "intro",
              "full"
            ],
            "type": "string",
            "description": "How much text <code>extract</code> carries: <code>intro</code> is the lead section only (MediaWiki <code>exintro</code>), <code>full</code> is the whole article as plain text.<br><br><b>Empty value:</b> falls back to <code>intro</code>.<br><br><b>Consequence:</b> <code>full</code> can return tens of kilobytes per row, which makes the dataset far heavier to move and to embed; the price per row does not change."
          },
          "extractChars": {
            "title": "Extract Character Limit",
            "minimum": 50,
            "maximum": 1200,
            "type": "integer",
            "description": "Truncate <code>extract</code> to roughly this many characters, at a word boundary (MediaWiki <code>exchars</code>, maximum 1200).<br><br><b>Empty value:</b> no truncation - you get the whole lead section, or the whole article when scope is <code>full</code>.<br><br><b>Consequence:</b> a small limit keeps rows uniform and cheap to embed for RAG; it does not change the number of rows or the price."
          },
          "includeCategories": {
            "title": "Include Categories",
            "type": "boolean",
            "description": "Return every category the page belongs to in <code>categories</code>, continued until the list is complete rather than cut off at the first 500 of the batch.<br><br><b>Turned off:</b> <code>categories</code> is an empty array.<br><br><b>Consequence:</b> a page with hundreds of categories can need a follow-up request, so leaving this on can add requests but never adds rows or cost."
          },
          "includeHiddenCategories": {
            "title": "Include Hidden Maintenance Categories",
            "type": "boolean",
            "description": "Include Wikipedia's hidden housekeeping categories, such as <code>All articles with unsourced statements</code> or <code>Articles with short description</code>.<br><br><b>Turned off (the default):</b> hidden categories are filtered out at the API with <code>clshow=!hidden</code>, so <code>categories</code> holds only the topical ones a reader sees.<br><br><b>Consequence:</b> turning it on typically doubles the length of the category list without adding topical signal."
          },
          "includeWikidataId": {
            "title": "Include Wikidata Item ID",
            "type": "boolean",
            "description": "Return the page's Wikidata item in <code>wikidataId</code> (e.g. <code>Q11660</code>), read from <code>pageprops.wikibase_item</code> in the same request as the text.<br><br><b>Turned off:</b> <code>wikidataId</code> is an empty string.<br><br><b>Consequence:</b> free - no extra request and no extra charge - and it is what lets you join these rows to Wikidata, DBpedia or your own entity table across languages."
          },
          "includePageImage": {
            "title": "Include Lead Image Thumbnail",
            "type": "boolean",
            "description": "Return a 400px thumbnail URL for the page's lead image in <code>thumbnailUrl</code>.<br><br><b>Turned off:</b> <code>thumbnailUrl</code> is an empty string.<br><br><b>Consequence:</b> free to request, but many articles have no lead image at all, so expect this field to be populated on a minority of rows and never treat it as required."
          },
          "includeLanguageCount": {
            "title": "Include Language Edition Count",
            "type": "boolean",
            "description": "Count how many other language editions carry the same page and return it in <code>languageCount</code> - a good proxy for how significant a topic is.<br><br><b>Turned off (the default):</b> <code>languageCount</code> is <code>0</code>.<br><br><b>Consequence:</b> language links are paged separately by the API, so turning this on can add a continuation request per batch of 20 pages. It adds no rows and no cost."
          },
          "includePageviews": {
            "title": "Include 30-Day Pageviews",
            "type": "boolean",
            "description": "Return how many times the page was viewed over the last 30 days in <code>pageviews30d</code>, summed from MediaWiki's own daily <code>prop=pageviews</code> series.<br><br><b>Turned off:</b> <code>pageviews30d</code> is <code>0</code>.<br><br><b>Consequence:</b> free - it rides along in the same request as the text - and it is the only demand signal Wikipedia exposes, so it is what lets you rank a topic corpus by real readership rather than by article length."
          },
          "includeLinks": {
            "title": "Include Outgoing Article Links",
            "type": "boolean",
            "description": "Return the article-namespace pages this page links to, as <code>links</code>, with the total in <code>linkCount</code>. Template, file and category links are excluded, so what you get is the topical link graph.<br><br><b>Turned off (the default):</b> <code>links</code> is an empty array and <code>linkCount</code> is <code>0</code>.<br><br><b>Consequence:</b> this is the one switch that really costs requests - links page 500 at a time across the whole batch, so a 25-row run measured 37 requests with it on against 4 with it off. It adds no rows and no charge."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}