Skip to content

mw wiki rest

Releasev0.35.0 · cfeceb67

mw wiki rest METHOD PATH [flags]

Call an explicit HTTP method and path relative to the selected installation’s rest.php. Leading slashes are REST-relative. Fields are query parameters; –input supplies a body without changing JSON types. Saved wiki profiles also apply to REST. External URLs and redirects are not followed. Discovery is optional.

--content-type <string>
Content type for --input Default: application/json.
-f, --field <stringArray>
Query parameter as name=value (repeatable; repeated keys are preserved)
--format <string>
Format the specified output
--input <string>
Request body file, or - for stdin
-o, --output <string>
Output format (jq|json) Default: json.
--raw
Print response bytes unchanged
--timeout <duration>
Total request timeout, including login Default: 30s.
--anon
Use anonymous access instead of saved credentials
--help
Help for this command
--no-interaction
Do not ask any interactive questions
--password <string>
Wiki login password (or bot password)
--password-file <string>
Read the login password from a file
--profile <string>
Saved profile name or REALM/NAME
--realm <string>
Shared-login realm (wikimedia and wikibase-world are built in)
--username <string>
Wiki login username (use Name@bot for a bot password)
-v, --verbose <count>
Increase output verbosity. Example: --verbose=2 or -vv
--wiki <string>
Wiki URL or API endpoint
Terminal window
mw wiki rest get /v1/page/Earth/bare
mw wiki rest get /v1/search/page -f q=Earth
mw wiki rest post /wikibase/v1/entities/items --input item.json
Report an issue with this page

Report a documentation issue

The report includes this page’s link, section and documentation version.

Review and submit on Phabricator, or run the command using your saved CLI profile. The command asks before creating the task.