{
  "openapi": "3.0.1",
  "info": {
    "title": "MediaWiki API Extractor",
    "description": "Point at ANY MediaWiki wiki's Action API (Wikipedia, Fandom, wiki.gg, or any corporate/OSS wiki) and pull structured data: full-text search, enumerate pages, list category members, fetch page text + revisions, or read site info. Handles continue-token pagination. Pay per record.",
    "version": "0.1",
    "x-build-id": "u2vIhJK5Ufuh0gQsg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datamule~mediawiki-api-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datamule-mediawiki-api-extractor",
        "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/datamule~mediawiki-api-extractor/runs": {
      "post": {
        "operationId": "runs-sync-datamule-mediawiki-api-extractor",
        "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/datamule~mediawiki-api-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-datamule-mediawiki-api-extractor",
        "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": [
          "apiUrl"
        ],
        "properties": {
          "apiUrl": {
            "title": "MediaWiki API endpoint URL",
            "type": "string",
            "description": "The MediaWiki Action API endpoint of ANY wiki — it ends in /api.php or /w/api.php. Examples: https://en.wikipedia.org/w/api.php (Wikipedia), https://terraria.wiki.gg/api.php (wiki.gg), https://<yourwiki>.fandom.com/api.php (any of the 40,000+ Fandom communities), https://commons.wikimedia.org/w/api.php, https://www.mediawiki.org/w/api.php, or a corporate/government/OSS wiki. Tip: most wikis link their API at Special:Version; the endpoint is usually the site root + /api.php or /w/api.php."
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "allpages",
              "category",
              "content",
              "siteinfo"
            ],
            "type": "string",
            "description": "What to extract. search = full-text search (one row per hit). allpages = enumerate a namespace's pages alphabetically. category = list a category's members. content = fetch the text/extract + latest-revision metadata for specific titles. siteinfo = one row of wiki metadata (name, version, language, counts).",
            "default": "search"
          },
          "query": {
            "title": "Search query (search mode)",
            "type": "string",
            "description": "The full-text search query, used in search mode (the srsearch parameter). Supports the wiki's search syntax, e.g. climate change, or intitle:physics. Required in search mode; ignored otherwise."
          },
          "category": {
            "title": "Category (category mode)",
            "type": "string",
            "description": "The category whose members to list, used in category mode. Give the bare name (Physics) or the full title (Category:Physics) — the actor adds the Category: prefix if missing. On a non-English wiki use that wiki's localized namespace prefix (e.g. Kategorie:Physik). Required in category mode; ignored otherwise."
          },
          "categoryType": {
            "title": "Category member type (category mode)",
            "enum": [
              "all",
              "page",
              "subcat",
              "file"
            ],
            "type": "string",
            "description": "Optionally restrict category members to a single type. Leave as 'all' for every member.",
            "default": "all"
          },
          "titles": {
            "title": "Page titles (content mode)",
            "type": "array",
            "description": "The page titles to fetch in content mode — one per row (or, if you paste a single string, separated by newlines or | pipes). Example: Cat, Dog, Felidae. You can harvest titles from a search or category run first, then feed them here. Required in content mode; ignored otherwise.",
            "items": {
              "type": "string"
            }
          },
          "introOnly": {
            "title": "Intro extract only (content mode)",
            "type": "boolean",
            "description": "In content mode, return only the page's lead/intro section as the plain-text extract (faster, smaller) instead of the full article text. On by default; turn off to fetch the entire page extract.",
            "default": true
          },
          "includeWikitext": {
            "title": "Include raw wikitext (content mode)",
            "type": "boolean",
            "description": "In content mode, also fetch each page's raw wikitext (the latest revision's main-slot source) into the wikitext column. Off by default (adds payload). The plain-text extract is always included regardless.",
            "default": false
          },
          "namespace": {
            "title": "Namespace (search / allpages)",
            "type": "integer",
            "description": "The numeric namespace to restrict to in search and allpages modes. 0 = main/article namespace (the default), 6 = File, 14 = Category, etc. Leave empty for main namespace."
          },
          "apFrom": {
            "title": "Start page (allpages mode)",
            "type": "string",
            "description": "In allpages mode, begin enumeration at this page title (the apfrom parameter), e.g. Ba to start at pages beginning with 'Ba'. Leave empty to start from the beginning of the namespace."
          },
          "apFilterRedir": {
            "title": "Redirect filter (allpages mode)",
            "enum": [
              "all",
              "nonredirects",
              "redirects"
            ],
            "type": "string",
            "description": "In allpages mode, whether to include redirects. 'all' = both (default), 'nonredirects' = real pages only, 'redirects' = redirects only.",
            "default": "all"
          },
          "maxRecords": {
            "title": "Max records (total)",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum total number of records to emit across pagination. The rendered first-run cap is 25; each emitted row is one billable `record` event. In content mode this also caps how many titles are fetched.",
            "default": 25
          },
          "bearer": {
            "title": "Bearer token (optional)",
            "type": "string",
            "description": "Optional bearer token for a private / access-gated wiki. Sent as Authorization: Bearer *** — NOT required for public wikis (Wikipedia, Fandom, wiki.gg) — leave empty. Never logged."
          },
          "extraHeaders": {
            "title": "Extra request headers",
            "type": "object",
            "description": "Optional extra HTTP headers to send with every request, as a JSON object, e.g. {\"x-api-key\": \"...\"} for a wiki behind an API gateway. Leave empty for public wikis."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}