/wikimedia-data-collection:wikimedia-analytics-apifrom wikimedia-data-collection
Collect 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.
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.
Public, key-free time-series metrics. No scraping of Stats/Grafana — hit the REST endpoint and get clean JSON.
Prerequisites (Cowork): network access enabled; /outputs/ mounted.
Base: https://wikimedia.org/api/rest_v1/metrics/..., GET, JSON.
Send a descriptive User-Agent (required). Path params are slash-delimited;
URL-encode article titles (spaces → _ then percent-encode /).
/pageviews/per-article/{project}/{access}/{agent}/{article}/{granularity}/{start}/{end}
e.g. en.wikipedia/all-access/user/Albert_Einstein/daily/20240101/20241231/pageviews/aggregate/{project}/{access}/{agent}/{granularity}/{start}/{end}/pageviews/top/{project}/{access}/{year}/{month}/{day}/unique-devices/{project}/{access-site}/{granularity}/{start}/{end}/edits/aggregate/…, /editors/aggregate/…,
/registered-users/new/… under …/metrics/.Params: access ∈ all-access|desktop|mobile-web|mobile-app; agent ∈
user|spider|automated|all-agents (use user to exclude bots);
granularity ∈ daily|monthly; dates YYYYMMDD (or YYYYMMDDHH).
import urllib.parse, urllib.request, json, csv
UA = "WikimediaResearch/1.0 ([email protected]; collecting pageview metrics)"
def pageviews(project, article, start, end, access="all-access", agent="user"):
art = urllib.parse.quote(article.replace(" ", "_"), safe="")
url = ("https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/"
f"{project}/{access}/{agent}/{art}/daily/{start}/{end}")
req = urllib.request.Request(url, headers={"User-Agent": UA})
return json.load(urllib.request.urlopen(req, timeout=30))["items"]
items = pageviews("en.wikipedia", "Albert Einstein", "20240101", "20241231")
with open("/outputs/einstein_pageviews.csv", "w", newline="") as f:
w = csv.writer(f); w.writerow(["date", "views"])
for it in items: w.writerow([it["timestamp"][:8], it["views"]])
agent=all-agents with
user across a dataset (bots inflate counts).Reference: REST API · AQS pageviews · Analytics metrics docs.
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
/mediawiki-action-apiCollect 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./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.Other plugins' skills for the same job