{
  "openapi": "3.0.1",
  "info": {
    "title": "Wikipedia Scraper — Markdown, Infobox Data & Pageviews",
    "description": "Wikipedia scraper for AI and RAG: fetch articles by title, URL, search or category in any language as clean Markdown, with the infobox as key/value JSON, summary, sections, categories, Wikidata id, coordinates and pageviews. Public Wikimedia APIs, no proxy. From US$0.80 per 1,000 articles.",
    "version": "0.1",
    "x-build-id": "YtBkAoyu6LgZScjtl"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fabrikit~wikipedia-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fabrikit-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/fabrikit~wikipedia-scraper/runs": {
      "post": {
        "operationId": "runs-sync-fabrikit-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/fabrikit~wikipedia-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-fabrikit-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",
        "properties": {
          "articles": {
            "title": "Article titles or URLs",
            "type": "array",
            "description": "Article titles (\"Machu Picchu\", in the edition set by Language) or full Wikipedia URLs in any language (https://de.wikipedia.org/wiki/Berlin, mobile en.m.wikipedia.org links and ?curid= links work too). Redirects are followed.",
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Full-text searches on Wikipedia (the same engine as the site's search box). Each query returns up to \"Max articles per query or category\" articles, best match first.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Wikipedia categories (\"Machine learning algorithms\", \"Category:Inca\" or a category URL). Takes the articles filed directly in the category; subcategories are not followed.",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Wikipedia language edition for titles, search queries and categories given without a URL: en, de, es, fr, pt, it, ja, zh, ru, nl, pl, simple... URLs always use their own edition.",
            "default": "en"
          },
          "maxItems": {
            "title": "Max articles",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Total number of articles to save across all sources (exact). An article reached twice is saved and charged once.",
            "default": 20
          },
          "maxArticlesPerQuery": {
            "title": "Max articles per query or category",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "How many articles to take from each search query and from each category.",
            "default": 10
          },
          "contentFormat": {
            "title": "Article body format",
            "enum": [
              "markdown",
              "text",
              "html",
              "none"
            ],
            "type": "string",
            "description": "Markdown (headings, lists, tables, code and LaTeX math kept), plain text, cleaned HTML, or none (metadata, infobox and summary only).",
            "default": "markdown"
          },
          "includeLinks": {
            "title": "Keep links in Markdown",
            "type": "boolean",
            "description": "Keep links as [text](https://...) in the Markdown / HTML. Off gives cleaner text for embeddings and LLMs.",
            "default": false
          },
          "dropReferenceSections": {
            "title": "Drop reference sections",
            "type": "boolean",
            "description": "Remove trailing sections that only hold references and links (See also, Notes, References, Further reading, External links and their equivalents in the main languages). Citation markers like [1] are always removed.",
            "default": true
          },
          "includePageviews": {
            "title": "Include pageviews",
            "type": "boolean",
            "description": "Add the article's human pageviews (bots and crawlers excluded) for the last N days from the Wikimedia Pageviews API.",
            "default": true
          },
          "pageviewsDays": {
            "title": "Pageviews window (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Number of full days, ending yesterday (UTC), to add up in pageviews.",
            "default": 30
          },
          "includeDailyPageviews": {
            "title": "Include daily pageviews",
            "type": "boolean",
            "description": "Also return the day-by-day series (date, views) in pageviewsDaily.",
            "default": false
          },
          "includeLanguageLinks": {
            "title": "Include other language versions",
            "type": "boolean",
            "description": "List the article's versions in other languages (language code, title, URL) in languageVersions. The count is always in languageCount.",
            "default": false
          },
          "maxConcurrency": {
            "title": "Articles in parallel",
            "minimum": 1,
            "maximum": 5,
            "type": "integer",
            "description": "How many articles are fetched at the same time (1-5). The default keeps well within Wikimedia's API etiquette.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Not needed: the Wikimedia APIs accept direct connections. Leave off unless your runs get HTTP 403 / 429.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}