mw api
Releasev0.35.0 · cfeceb67
Watch it in action
mw api <endpoint-or-url> [flags]Make a REST request relative to https://wikimedia.org/api/rest_v1/, or supply an absolute HTTP(S) URL. JSON is indented and coloured in a terminal and compact when piped. Other response bodies are printed unchanged. Requests return a failing exit status for HTTP errors. No credentials are added automatically.
Fields are strings: they form a JSON body and select POST by default, or query parameters with –method GET. Use –input FILE (or - for stdin) for a custom body, and –header for authentication or content types.
Options
Section titled “Options”Global options
Section titled “Global options”Examples
Section titled “Examples”mw api 'metrics/pageviews/top/en.wikipedia.org/all-access/2025/01/01'mw api 'https://en.wikipedia.org/w/rest.php/v1/search/page' -X GET -f q=Earthmw api 'metrics/pageviews/top/en.wikipedia.org/all-access/2025/01/01' --output jq --format '.items[0].articles[:5]'mw api 'https://example.org/api/resource' -X POST --input request.json -H 'Content-Type: application/json'See also
Section titled “See also”Page views: —Sessions: —