MediaWiki API Extractor
Pricing
from $0.35 / 1,000 records
MediaWiki API Extractor
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.
Pricing
from $0.35 / 1,000 records
Rating
0.0
(0)
Developer
Datamule
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
24 days ago
Last modified
Categories
Share
Point at ANY MediaWiki wiki's Action API and pull structured data — one actor, every wiki.
Beyond Wikipedia, tens of thousands of sites run MediaWiki:
every one of the 40,000+ Fandom communities, every
wiki.gg gaming wiki, Wikimedia Commons / Wiktionary / Wikidata,
and countless corporate, government and open-source wikis. They all answer the identical
api.php?action=query grammar and paginate with the same continue token — so this single
actor covers every install, with no per-site scraper to maintain.
Give it the wiki's API endpoint (the URL ending in /api.php or /w/api.php) and pick a
mode. Each result row is a set of clean, flat columns plus a lossless _raw object holding
the untouched API item.
Try it now
Paste this input to run a bounded search of English Wikipedia:
{"apiUrl": "https://en.wikipedia.org/w/api.php","mode": "search","query": "cat","namespace": 0,"maxRecords": 25}
At the current FREE-tier rate, the Actor event price is $0.0005 per record ($0.50 per 1,000 records). This example can emit at most 25 rows, so its maximum capped Actor event charge is $0.0125. Apify infrastructure usage is additional.
Modes
| Mode | What it does | Key input |
|---|---|---|
| search | Full-text search — one row per hit (page id, title, snippet, size, word count, timestamp) | query |
| allpages | Enumerate a namespace's pages alphabetically (page id, namespace, title) | apFrom (optional) |
| category | List a category's members, optionally filtered to pages / subcategories / files | category |
| content | For specific titles: plain-text extract, latest-revision metadata, page length, page URL, and optionally the raw wikitext | titles |
| siteinfo | One row of wiki metadata: name, MediaWiki version, language, base URL, article path, page & article counts | — |
Every list mode follows MediaWiki's pagination automatically up to your Max records cap.
Example inputs
Search Wikipedia:
{ "apiUrl": "https://en.wikipedia.org/w/api.php", "mode": "search", "query": "climate change", "maxRecords": 100 }
List a Fandom category:
{ "apiUrl": "https://community.fandom.com/api.php", "mode": "category", "category": "Help", "maxRecords": 500 }
Fetch page content from a wiki.gg wiki:
{ "apiUrl": "https://terraria.wiki.gg/api.php", "mode": "content", "titles": ["Terraria Wiki", "Boss"], "introOnly": true }
Read a wiki's site info:
{ "apiUrl": "https://www.mediawiki.org/w/api.php", "mode": "siteinfo" }
Finding a wiki's API endpoint
Most wikis link it from their Special:Version page. The endpoint is usually the site root plus
/api.php or /w/api.php:
- Wikipedia and Wikimedia sites:
https://en.wikipedia.org/w/api.php,https://commons.wikimedia.org/w/api.php - Fandom:
https://<wiki>.fandom.com/api.php - wiki.gg:
https://<wiki>.wiki.gg/api.php
Output
Records share one nullable schema, so datasets are clean and predictable across modes and wikis.
Common columns include pageid, ns, title, snippet, size, wordcount, timestamp,
type, extract, wikitext, pageLength, revId, revTimestamp, revUser, revComment,
pageUrl, and (in siteinfo) sitename, generator, lang, base, pageCount,
articleCount. Every row also carries _raw — the full original API item, so nothing is lost.
Genuine representative row
Selected fields from row 1 of a disposable verification run on 2026-07-14 using the exact
Try it now input above are shown below. These are point-in-time source values, not a promise of
current values; the omitted mode-specific columns were null, and _raw retained the original
API item.
{"_apiUrl": "https://en.wikipedia.org/w/api.php","_mode": "search","_index": 0,"pageid": 6678,"ns": 0,"title": "Cat","snippet": "The cat (Felis catus), also called domestic cat and house cat, is a small domesticated carnivorous mammal. It is a member of Felidae, the family of mammals","size": 172618,"wordcount": 17486,"timestamp": "2026-07-09T18:54:54Z","type": null,"extract": null,"sitename": null}
Export search results to CSV with Python (API recipe)
This script uses only the Python standard library. It starts one small Wikipedia search run,
waits for it to finish (up to 5 minutes), and writes pageid, title, pageUrl and snippet
to mediawiki_search.csv. Set your token first: export APIFY_TOKEN=... (Console → Settings →
API & Integrations). The token is sent as a Bearer header, never in the URL.
import csv, json, os, sys, time, urllib.requestTOKEN = os.environ["APIFY_TOKEN"]API = "https://api.apify.com/v2"RUN_INPUT = {"apiUrl": "https://en.wikipedia.org/w/api.php", "mode": "search","query": "cat", "namespace": 0, "maxRecords": 10}MAX_CHARGE_USD = 0.01 # hard cap on this run's Actor event chargesOUT = "mediawiki_search.csv"def call(method, path, body=None):req = urllib.request.Request(API + path, method=method,data=None if body is None else json.dumps(body).encode(),headers={"Authorization": "Bearer " + TOKEN, "Content-Type": "application/json"})with urllib.request.urlopen(req, timeout=60) as r:return json.load(r)actor_id = call("GET", "/acts/datamule~mediawiki-api-extractor")["data"]["id"]run = call("POST", f"/acts/{actor_id}/runs?maxTotalChargeUsd={MAX_CHARGE_USD}", RUN_INPUT)["data"]deadline = time.time() + 300while run["status"] in ("READY", "RUNNING") and time.time() < deadline:time.sleep(5)run = call("GET", f"/actor-runs/{run['id']}")["data"]if run["status"] != "SUCCEEDED":sys.exit(f"Run {run['id']} ended {run['status']}; {OUT} was not changed.")rows = call("GET", f"/datasets/{run['defaultDatasetId']}/items?clean=true&format=json")fields = ["pageid", "title", "pageUrl", "snippet"]with open(OUT + ".tmp", "w", newline="", encoding="utf-8") as f:w = csv.DictWriter(f, fieldnames=fields, extrasaction="ignore")w.writeheader()w.writerows(rows)os.replace(OUT + ".tmp", OUT) # only replace the old file after a successful runprint(f"Run {run['id']}: {len(rows)} rows -> {OUT}")
What the result means:
- Succeeded with 0 rows — the run worked but the wiki had no matches (or the charge cap could not cover one record). You get a CSV with only the header row. That is not an error.
- Failed, aborted or timed out — the script stops with the run ID and status and leaves
any earlier
mediawiki_search.csvuntouched. Open the run's log in Console to see why. A failed run may still have written some rows; check its dataset before you rerun. maxRecordsvsmaxTotalChargeUsd—maxRecordscaps how many rows you ask for;maxTotalChargeUsdcaps what you can be charged. The run stops at whichever comes first. Ten rows cost at most $0.005 inrecordevents at the FREE-tier price. Apify infrastructure usage is billed separately and is extra.- Source terms — rows come from the public wiki API you point at. Wikipedia text is
CC BY-SA; keep
pageUrlnext to any text you reuse so it can be attributed. Other wikis may have different terms, rate limits or login rules, so not every wiki will be reachable.
Behavior & limits
- No match / empty category / missing page → returns cleanly (0 rows, or a row flagged
missing: true), never crashes. - Not a MediaWiki endpoint (an HTML page or a 404) → fails fast with a clear message.
- Polite by default — sends a descriptive User-Agent, respects the API's
maxlagsignal, and backs off on rate limits, so it plays nicely with community wikis. - Private wikis — optionally supply a bearer token and/or extra request headers. These are never required for public wikis and are never logged.
Source terms & responsible use
- MediaWiki provides the API protocol, but each wiki/provider controls its terms, content licence, attribution requirements, availability, access policy, and rate limits. Review the target wiki's terms, API policy, and content licence before collecting or reusing data, and preserve any required source, author, and licence attribution. This Actor does not grant rights to source content.
- Use modest caps, honour provider limits and
Retry-Afterguidance, and do not bypass access controls. The Actor sendsmaxlag=5, throttles requests, and retries transientmaxlag, 429, and server errors. - Source counts, content, timestamps, and freshness can change. Results are point-in-time API responses; availability, completeness, speed, freshness, and total cost are not guaranteed.
Troubleshooting
- Invalid API URL — use a complete
http://orhttps://Action API URL ending in/api.phpor/w/api.php, not an article, search-result, orSpecial:page URL. - HTML response or 404 — the URL usually points at a web page or a disabled/moved API. Find
the Action API link on the wiki's
Special:Versionpage and use that endpoint directly. - Missing mode-specific input —
searchneedsquery,categoryneedscategory, andcontentneeds one or moretitles.allpagesandsiteinfoneed no additional key input. - No match or missing page — a search or category with no matches correctly emits 0 rows.
Content mode can emit a row with
missing: true; check spelling, namespace, and the target wiki. maxlag, 429, or transient server error — built-in backoff retries these responses. If the provider remains busy, reducemaxRecords, honour its retry window, and run again later.- Private or access-gated wiki — provide the required bearer token or request headers and confirm that the account can call the Action API. A 401 or 403 means access is still denied.
Pricing
Pay-per-event: one record charge per row emitted. At the current FREE-tier event price,
that is $0.0005 per record or $0.50 per 1,000 records. A run that returns nothing incurs
no record event charge. The 25-row Try it now example has a maximum capped Actor event charge
of $0.0125. Apify infrastructure usage is billed separately and is additional.
Your max run charge is respected. The Actor writes only the records your run's maximum charge covers, billing each one as it is written, and does not fetch another results page (or more content titles) than that budget can pay for. If the budget does not cover even one record, no request is sent to the wiki and nothing is billed. If a charge cannot be recorded, the run fails instead of silently continuing.