{
  "openapi": "3.0.1",
  "info": {
    "title": "Fandom Scraper",
    "description": "Scrape any Fandom / Wikia wiki: article text, infobox data, categories, images, and search results via the public MediaWiki API.",
    "version": "1.0",
    "x-build-id": "ZWwpbHWTFKKH7UlSn"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/khadinakbar~fandom-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-khadinakbar-fandom-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/khadinakbar~fandom-scraper/runs": {
      "post": {
        "operationId": "runs-sync-khadinakbar-fandom-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/khadinakbar~fandom-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-khadinakbar-fandom-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": {
          "startUrls": {
            "title": "Fandom article URLs",
            "type": "array",
            "description": "Exact Fandom/Wikia article URLs to scrape, e.g. 'https://harrypotter.fandom.com/wiki/Wand'. Works across any language path. When set, this takes priority over the wiki + search/category/titles modes. Leave empty to use a search, category, or title-list query instead.",
            "items": {
              "type": "string"
            }
          },
          "wiki": {
            "title": "Wiki (subdomain or host)",
            "type": "string",
            "description": "The Fandom wiki to query in search/category/titles mode. Accepts a subdomain like 'harrypotter' or a full host like 'harrypotter.fandom.com'. Ignored when 'Fandom article URLs' is provided. NOT a full article URL — use the URLs field for those."
          },
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Free-text full-text search run on the chosen wiki (e.g. 'elder wand'). The top matching articles are scraped, up to 'Max results'. Requires the 'Wiki' field. Leave empty if using URLs, titles, or category mode."
          },
          "category": {
            "title": "Category",
            "type": "string",
            "description": "Scrape every article in this wiki category, e.g. 'Wands' or 'Category:Wands' (the 'Category:' prefix is optional). Members are paginated up to 'Max results'. Requires the 'Wiki' field. NOT a search query."
          },
          "titles": {
            "title": "Page titles",
            "type": "array",
            "description": "Explicit list of article titles on the chosen wiki to scrape, e.g. ['Wand', 'Elder Wand']. Requires the 'Wiki' field. Use this when you already know the exact pages; use 'Search query' for discovery.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of articles to scrape in search or category mode. Bounds cost and runtime. Defaults to 50. Ignored in URLs and titles mode, which scrape exactly what you list.",
            "default": 50
          },
          "includeFullText": {
            "title": "Include full plain text",
            "type": "boolean",
            "description": "When true, each record includes the full article body as clean plain text ('contentText'), not just the summary. Increases record size. Defaults to false for lean, agent-friendly output.",
            "default": false
          },
          "includeHtml": {
            "title": "Include rendered HTML",
            "type": "boolean",
            "description": "When true, each record includes the article's rendered HTML body ('contentHtml'). Large. Defaults to false.",
            "default": false
          },
          "includeWikitext": {
            "title": "Include raw wikitext",
            "type": "boolean",
            "description": "When true, each record includes the raw MediaWiki wikitext source ('wikitext'). Useful for template/markup analysis. Defaults to false.",
            "default": false
          },
          "maxLinks": {
            "title": "Max links per article",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Cap on how many internal and external links are included per record, keeping output lean. Defaults to 100. Set to 0 to omit links entirely.",
            "default": 100
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy settings. Defaults to Apify Proxy (datacenter), which is sufficient for the MediaWiki API. Switch to residential only if you hit rate limits on very large jobs.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}