askargs module provides the same querying capability as action=ask, but accepts the query components as separate parameters instead of a single serialized ask-syntax string. This makes it easier to construct queries programmatically without manually encoding pipe-delimited ask syntax.
Endpoint
Parameters
The query conditions — the requirements a subject must meet to be included in results. Accepts multiple values separated by
|.This corresponds to the [[...]] part of an #ask query. For example, Modification date::+ matches all pages that have any modification date.The query printouts — the properties to display for each matching subject. Accepts multiple values separated by
|.This corresponds to the ?Property parts of an #ask query. Omit this parameter to return only subject page names.Additional query parameters — everything that is neither a condition nor a printout. Accepts multiple values separated by
|.This includes options like sort=, order=, limit=, and offset=. For example: sort=Modification date|order=desc|limit=20.Controls the serialization format of the response. Accepted values:
2 or 3.The MediaWiki API output format. Use
json for machine-readable output, jsonfm for browser-readable pretty-printed JSON, or xml for XML output.How conditions map to ask syntax
Inaction=ask, conditions are written inside double brackets: [[Category:Books]]. In action=askargs, you supply the condition content directly, without the brackets:
action=ask | action=askargs |
|---|---|
[[Modification date::+]] | conditions=Modification date::+ |
[[Category:Books]] | conditions=Category:Books |
[[Has author::Jane]][[Category:Books]] | conditions=Has author::Jane|Category:Books |
Multiple conditions are separated by
| in the conditions parameter. Each condition implicitly receives the [[...]] wrapping.Examples
Response structure
The response format is identical toaction=ask. See the ask response structure for the full field reference.
Comparison with action=ask
| Feature | action=ask | action=askargs |
|---|---|---|
| Query syntax | Single query string, fully encoded ask syntax | Separate conditions, printouts, parameters |
| Ease of construction | Requires serialization of the full ask string | Easier to build programmatically |
| Expressiveness | Full ask language | Same underlying engine — equivalent power |
| Multiple conditions | Concatenated in the query string | Pipe-separated in conditions |
| Output format | Identical | Identical |
action=askargs when building queries dynamically in application code. Use action=ask when you have a pre-composed ask query string or are porting an existing #ask parser function call.