What is the MediaWiki API?
The MediaWiki API is a web service that provides programmatic access to wiki data and functionality. It is
available on any MediaWiki installation (including Wikipedia, Fandom wikis, Wikidata, and self-hosted
company wikis) at the api.php endpoint. Using the API, you can retrieve page content, metadata,
revision histories, images, and structured data without scraping HTML — which is both faster and less
brittle than web scraping.
Understanding the API URL Structure
A typical MediaWiki content export API request looks like this:
https://en.wikipedia.org/w/api.php?action=query&titles=MediaWiki|PHP&prop=revisions&rvprop=content&format=json
The key parameters are: action (query, parse, etc.), titles (pipe-separated page
names), prop (what properties to return), and format (json, xml, etc.). The
titles parameter allows up to 50 pages per request — our tool automatically splits larger
lists into batches and generates one API URL per chunk.
Common Use Cases for Bulk Wiki Exports
- Content Auditing: Export entire categories of wiki pages to a JSON file, then analyze word counts, last-modified dates, and authors to identify stale content that needs updating.
- AI Training Data: Researchers extract Wikipedia articles at scale to build datasets for NLP models. The raw wikitext (markup) format is often preferred over HTML for this purpose.
- Internal Wiki Migration: When migrating a company wiki (e.g., from Confluence to a MediaWiki-based system or vice versa), the API enables scripted extraction of all articles into structured JSON for transformation.
- Link Graph Analysis: Security researchers and SEO analysts extract all pages from a wiki domain to build a link graph, identifying hubs, orphaned pages, and internal linking patterns.
Output Formats Explained
Our tool generates API URLs in multiple formats: JSON is recommended for programmatic processing (most languages have native JSON parsers). XML is useful for legacy systems or when using XSLT for transformation. PHP Serialized format is useful when consuming the API directly within a PHP application. The "formatted" variants (jsonfm, xmlfm) return human-readable pretty-printed output suitable for manual inspection in a browser.



