/wikimedia-data-collection:mediawiki-action-apifrom wikimedia-data-collection
Collect content and metadata from any Wikimedia wiki (Wikipedia, Commons, Wiktionary, Meta…) via the MediaWiki Action API — article wikitext, revisions and revision history, page metadata, categories, links, backlinks, and search results. Use whenever you need data FROM a wiki page or set of pages and would otherwise be tempted to open/scrape the article HTML. API-first, never scrape.
Ships in wikimedia-data-collection. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Get structured data from a wiki's api.php instead of parsing rendered HTML
(which truncates and changes). Read-only collection; no login needed for public
data.
Prerequisites (Cowork): network access enabled; an /outputs/ folder mounted
for the deliverable.
https://<wiki>/w/api.php (e.g. https://en.wikipedia.org/w/api.php), GET,
format=json&formatversion=2. Everything is action=query + a module.
Always send these params: format=json, formatversion=2, maxlag=5
(auto-backoff when the cluster is lagged — retry after the returned wait), and a
descriptive User-Agent header (required — see README).
action=query&prop=revisions&rvprop=content&rvslots=main&titles=<Title>prop=revisions&rvprop=ids|timestamp|user|comment&rvlimit=max (paginate via continue)prop=info|pageprops&inprop=urlprop=categories&cllimit=maxprop=links&pllimit=max · backlinks: list=backlinks&bltitle=<Title>list=categorymembers&cmtitle=Category:<X>&cmlimit=maxlist=search&srsearch=<query>&srlimit=maxredirects=1.Responses include a continue object when there's more. Loop: merge continue
params into the next request until continue is absent. Use …limit=max to
minimize round-trips. Add a small delay between pages.
import urllib.parse, urllib.request, json, time
API = "https://en.wikipedia.org/w/api.php"
UA = "WikimediaResearch/1.0 ([email protected]; collecting article metadata)"
def query(**params):
params.update(format="json", formatversion=2, maxlag=5)
out, cont = [], {}
while True:
q = {**params, **cont}
req = urllib.request.Request(API + "?" + urllib.parse.urlencode(q),
headers={"User-Agent": UA})
d = json.load(urllib.request.urlopen(req, timeout=30))
out.append(d.get("query", {}))
if "continue" not in d: break
cont = d["continue"]; time.sleep(0.5)
return out
# e.g. category members → write deliverable to /outputs/
pages = [p["title"] for r in query(list="categorymembers",
cmtitle="Category:Physics", cmlimit="max") for p in r.get("categorymembers", [])]
json.dump({"endpoint": API, "params": "categorymembers Category:Physics",
"pages": pages}, open("/outputs/physics_pages.json", "w"), indent=2)
prop=revisions/extracts.maxlag / continue. Don't hammer; add delays.Reference: API:Main page · API:Query · maxlag.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub lgelauff/wikimedia-coding-agent-lessons --plugin wikimedia-data-collection4 skills in this plugin
/phabricator-conduitCollect tasks, comments, and project data from Wikimedia Phabricator via the Conduit API (maniphest.search, transaction.search, project.search, user.search) — filter tasks by project/status/assignee/date, page through results, and pull history. Use whenever you need data from phabricator.wikimedia.org instead of scraping the task web UI./wikidata-sparqlCollect structured facts from Wikidata via the Wikidata Query Service (WDQS) SPARQL endpoint — entities matching criteria, properties, relationships, cross-wiki identifiers, counts. Use whenever you need STRUCTURED/queryable data ("all X that are Y", "the population/coordinates/identifiers of …") rather than prose from an article. The structured-data counterpart to the Action API./wikimedia-analytics-apiCollect Wikimedia traffic and contribution metrics via the public REST Analytics (AQS) API — per-article and aggregate pageviews, unique devices, edits, editors, and registered-user counts, by project / time range / granularity / access method. Use whenever you need quantitative time-series about wiki readership or editing, instead of any dashboard scraping.Other plugins' skills for the same job