{
  "openapi": "3.0.1",
  "info": {
    "title": "Wikipedia Articles Scraper",
    "description": "Wikipedia Articles Scraper extracts Wikipedia articles by search, title, URL or category in any language: summary, full text, sections, infobox, tables, categories, images, links, references, Wikidata id, size, last edit and RAG-ready text chunks.",
    "version": "1.0",
    "x-build-id": "0pT2qsoG7Bh4DBuml"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/neuro-scraper~wikipedia-articles-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-neuro-scraper-wikipedia-articles-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/neuro-scraper~wikipedia-articles-scraper/runs": {
      "post": {
        "operationId": "runs-sync-neuro-scraper-wikipedia-articles-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/neuro-scraper~wikipedia-articles-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-neuro-scraper-wikipedia-articles-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": {
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Keywords to search on Wikipedia. Every query is paged until maxResultsPerSearch articles.",
            "items": {
              "type": "string"
            }
          },
          "articleTitles": {
            "title": "Article titles",
            "type": "array",
            "description": "Exact article titles, e.g. Albert Einstein, Python (programming language).",
            "items": {
              "type": "string"
            }
          },
          "articleUrls": {
            "title": "Article URLs",
            "type": "array",
            "description": "Wikipedia article links of any language, e.g. https://en.wikipedia.org/wiki/Web_scraping.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Category names (with or without \"Category:\"); their articles are read.",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Wikipedia language code: en, de, fr, es, ja, ru, pt, it, zh, ar ... (URLs keep their own language).",
            "default": "en"
          },
          "maxResultsPerSearch": {
            "title": "Articles per query / category",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Articles per search query and per category (the search follows its own next-page offset).",
            "default": 10
          },
          "maxItems": {
            "title": "Max articles in total",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stops the run after this many articles.",
            "default": 1000
          },
          "includeFullContent": {
            "title": "Full article text",
            "type": "boolean",
            "description": "Adds the complete plain text (fullContent / mainText).",
            "default": true
          },
          "extractMainText": {
            "title": "Main text",
            "type": "boolean",
            "description": "Adds mainText (the article body as plain text).",
            "default": true
          },
          "extractSectionHeadings": {
            "title": "Sections",
            "type": "boolean",
            "description": "Adds sectionHeadings and sections (heading, level, text).",
            "default": true
          },
          "maxSectionDepth": {
            "title": "Max section depth",
            "minimum": 1,
            "maximum": 6,
            "type": "integer",
            "description": "Deepest heading level kept in sections (2 = only == top == sections).",
            "default": 6
          },
          "maxSectionTextLength": {
            "title": "Max section text length",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Cuts every section text to this many characters (0 = no cut).",
            "default": 0
          },
          "extractInfobox": {
            "title": "Infobox",
            "type": "boolean",
            "description": "Adds the infobox as key / value pairs (infobox, structured_key_data).",
            "default": true
          },
          "maxInfoboxFields": {
            "title": "Max infobox fields",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Keeps only the first N infobox fields (0 = all).",
            "default": 0
          },
          "extractTables": {
            "title": "Tables",
            "type": "boolean",
            "description": "Adds the article tables (wikitable) as header + rows.",
            "default": true
          },
          "maxTables": {
            "title": "Max tables",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "Keeps the first N tables of an article.",
            "default": 10
          },
          "extractWikitext": {
            "title": "Wikitext",
            "type": "boolean",
            "description": "Adds the raw wikitext source of the article.",
            "default": false
          },
          "includeLinks": {
            "title": "Links and references",
            "type": "boolean",
            "description": "Adds the internal article links and the external reference links.",
            "default": true
          },
          "includeImages": {
            "title": "Images",
            "type": "boolean",
            "description": "Adds the image URLs used in the article.",
            "default": true
          },
          "chunkSize": {
            "title": "Text chunk size (RAG)",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Splits the text into chunks of about N characters with their section (0 = no chunks).",
            "default": 1000
          },
          "enableCaching": {
            "title": "Read every article once",
            "type": "boolean",
            "description": "An article reached by several queries is read once; its row lists every query (matchedSearchQueries).",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Articles read in parallel.",
            "default": 8
          },
          "requestTimeoutSeconds": {
            "title": "Request timeout (s)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Timeout of one request.",
            "default": 30
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Tries per request before the article is skipped with an error row.",
            "default": 3
          },
          "userAgentContact": {
            "title": "Contact for the User-Agent (optional)",
            "type": "string",
            "description": "An e-mail or URL added to the User-Agent, as the Wikimedia User-Agent policy asks for heavy use."
          },
          "logLevel": {
            "title": "Log level",
            "enum": [
              "DEBUG",
              "INFO",
              "WARNING",
              "ERROR"
            ],
            "type": "string",
            "description": "How detailed the log is.",
            "default": "INFO"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Not needed: Wikipedia answers without a proxy. Turn it on only if your network is refused.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}