{
  "openapi": "3.0.1",
  "info": {
    "title": "Wikipedia Scraper: Articles, Full Text, Infobox, Pageviews",
    "description": "Scrape Wikipedia in any language with the official Wikimedia APIs: articles by title, URL, search, category or most viewed list, with summary, full text, sections, infobox, categories, links, images, Wikidata and daily or monthly pageviews.",
    "version": "1.0",
    "x-build-id": "76X42BvpUm7yS1yuf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zhtech~wikipedia-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zhtech-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/zhtech~wikipedia-scraper/runs": {
      "post": {
        "operationId": "runs-sync-zhtech-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/zhtech~wikipedia-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-zhtech-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": "Articles (titles or URLs)",
            "type": "array",
            "description": "One per line: an article title (Web scraping) or a Wikipedia link in any language (https://de.wikipedia.org/wiki/Berlin, mobile links, index.php?title= links and ?curid= links work too). A link uses its own language; a title uses the Language field. Redirects are followed. The prefilled example list is skipped automatically when you add a search, category or most viewed source.",
            "default": [
              "Web scraping",
              "Artificial intelligence",
              "Large language model",
              "Retrieval-augmented generation",
              "Search engine optimization",
              "Wikipedia",
              "Data mining",
              "https://en.wikipedia.org/wiki/Open_data",
              "https://de.wikipedia.org/wiki/Künstliche_Intelligenz",
              "https://fr.wikipedia.org/wiki/Tour_Eiffel"
            ],
            "items": {
              "type": "string"
            }
          },
          "searchQueries": {
            "title": "Search queries",
            "type": "array",
            "description": "Full text search on Wikipedia in the chosen language, one query per line. Results keep Wikipedia's relevance order (searchRank) and the matching snippet. Supports Wikipedia search syntax such as intitle:, incategory: and quotes.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerSearch": {
            "title": "Max articles per search query",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Top results to take from each search query (Wikipedia allows up to 10,000).",
            "default": 20
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Get the articles in a category, one per line: a name (Machine learning), Category:Machine learning, a localized prefix (Kategorie:Physik) or a category link.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "categoryDepth": {
            "title": "Subcategory depth",
            "minimum": 0,
            "maximum": 3,
            "type": "integer",
            "description": "0 takes only the articles directly in each category. 1 also takes articles of its subcategories, 2 and 3 go deeper. Each subcategory is visited once.",
            "default": 0
          },
          "maxResultsPerCategory": {
            "title": "Max articles per category",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop collecting a category (including its subcategories) after this many articles.",
            "default": 100
          },
          "includeMostViewed": {
            "title": "Add the most viewed articles",
            "type": "boolean",
            "description": "Adds the most viewed articles of a day or month in the chosen language (Wikimedia Pageviews API), with their rank and views. The main page, search pages and other non article pages are left out. Great for trend research.",
            "default": false
          },
          "mostViewedDate": {
            "title": "Most viewed: day or month",
            "type": "string",
            "description": "YYYY-MM-DD for a day, YYYY-MM for a whole month, or leave empty for the latest available day (lists appear about a day after the day ends).",
            "default": ""
          },
          "maxMostViewed": {
            "title": "Most viewed: how many",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Number of top articles to take (up to 1,000).",
            "default": 25
          },
          "language": {
            "title": "Language",
            "type": "string",
            "description": "Wikipedia language code used for titles, search, categories and the most viewed list: en, de, fr, es, it, ja, zh, ru, pt, ar, nl, pl, simple and about 340 more. Links in the Articles list keep their own language.",
            "default": "en"
          },
          "includeFullText": {
            "title": "Full text (plain)",
            "type": "boolean",
            "description": "The whole article as clean plain text with headings, plus a language aware word count. One extra API request per article and charged as article-full instead of article.",
            "default": false
          },
          "includeSections": {
            "title": "Sections",
            "type": "boolean",
            "description": "The article split into sections: heading, level and plain text of each, in order. Handy for RAG chunking. Charged as article-full.",
            "default": false
          },
          "includeInfobox": {
            "title": "Infobox fields",
            "type": "boolean",
            "description": "The infobox as label and value pairs with the values as readers see them (dates, places, lists), from the official REST API page HTML. Works in most languages; articles without an infobox get null. Charged as article-full.",
            "default": false
          },
          "includeHtml": {
            "title": "Article HTML",
            "type": "boolean",
            "description": "The full rendered article HTML (Parsoid HTML from the REST API). Large, 100 KB to 2 MB per article. Charged as article-full.",
            "default": false
          },
          "includeCategories": {
            "title": "Categories of each article",
            "type": "boolean",
            "description": "Visible categories (hidden maintenance categories are left out). Included in the base price.",
            "default": true
          },
          "includeLinks": {
            "title": "Links",
            "type": "boolean",
            "description": "Internal links to other articles and external links (URLs) of each article, up to the limit below. One extra API request per article.",
            "default": false
          },
          "maxLinksPerArticle": {
            "title": "Max links per article",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Cap for internal links and for external links, each.",
            "default": 500
          },
          "includeImages": {
            "title": "Images with license",
            "type": "boolean",
            "description": "Files used in each article with direct URL, size, MIME type, license, license URL and artist (for correct image attribution). Lead image and thumbnail are always included.",
            "default": false
          },
          "maxImagesPerArticle": {
            "title": "Max images per article",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Cap for the images list.",
            "default": 20
          },
          "includeLanguageLinks": {
            "title": "Other language versions",
            "type": "boolean",
            "description": "Title and URL of the same article in every other language edition. The number of languages (languageCount) is always included.",
            "default": false
          },
          "includeWikidata": {
            "title": "Wikidata entity",
            "type": "boolean",
            "description": "Adds the linked Wikidata item: label, description, aliases, instance of, country, occupation (with labels), birth, death and inception dates, coordinates, official website, image, sitelink count and all statements in a compact form. The Wikidata ID (QID) is always included.",
            "default": false
          },
          "skipDisambiguation": {
            "title": "Skip disambiguation pages",
            "type": "boolean",
            "description": "Leave out \"may refer to\" pages (not saved, not charged). Otherwise they are saved with isDisambiguation true.",
            "default": false
          },
          "includePageviews": {
            "title": "Pageviews",
            "type": "boolean",
            "description": "Views of each article from the official Wikimedia Pageviews API: total, daily average, peak and the full daily or monthly series (days without views filled with 0). Included in the base price.",
            "default": true
          },
          "pageviewsGranularity": {
            "title": "Granularity",
            "enum": [
              "daily",
              "monthly"
            ],
            "type": "string",
            "description": "Daily or monthly views. Monthly uses complete months only.",
            "default": "daily"
          },
          "pageviewsDays": {
            "title": "Period (days back)",
            "minimum": 1,
            "maximum": 4000,
            "type": "integer",
            "description": "How many days back from the end date, when no start date is set. 30 by default; with monthly granularity, 365 gives the last 12 complete months.",
            "default": 30
          },
          "pageviewsStartDate": {
            "title": "Start date",
            "type": "string",
            "description": "First day, YYYY-MM-DD (or YYYY-MM for monthly). Data starts 2015-07-01. Overrides Period.",
            "default": ""
          },
          "pageviewsEndDate": {
            "title": "End date",
            "type": "string",
            "description": "Last day, YYYY-MM-DD or YYYY-MM. Empty means yesterday (UTC).",
            "default": ""
          },
          "pageviewsAccess": {
            "title": "Device",
            "enum": [
              "all-access",
              "desktop",
              "mobile-web",
              "mobile-app"
            ],
            "type": "string",
            "description": "Count views from all devices or one type only. Also used for the most viewed list.",
            "default": "all-access"
          },
          "pageviewsAgent": {
            "title": "Visitor type",
            "enum": [
              "user",
              "all-agents",
              "automated",
              "spider"
            ],
            "type": "string",
            "description": "People only (default), or include automated traffic and crawlers.",
            "default": "user"
          },
          "pageviewRows": {
            "title": "Also save one row per day or month",
            "type": "boolean",
            "description": "Adds a pageview row (date, views) for every day or month of every article, ready for charts and spreadsheets. Each row is a cheap pageview-row event.",
            "default": false
          },
          "maxArticles": {
            "title": "Max articles (whole run)",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many article rows. 0 means no limit. Your maximum cost per run (set in the run options) is respected as well.",
            "default": 0
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed: the actor uses official public APIs. Leave it off. Residential proxy is not supported and is replaced with datacenter proxy automatically.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}