Function massRequest

  • Send API requests with an apilimit-susceptible query parameter all at once. For instance:

    {
    action: 'query',
    titles: 'A|B|C|D|...', // This parameter is subject to the apilimit of 500 or 50
    formatversion: '2'
    }

    Pass the multi-value field as an array, and then this function sends multiple API requests by splicing the array in accordance with the current user's apilimit (500 for bots, 50 otherwise). It is also neccesary to pass the name of the field to the second parameter of this function (if the request parameters have more than one multi-value field, an array can be passed to the second parameter).

    Parameters

    • params: DynamicObject

      The request parameters.

    • batchParams: string | string[]
    • Optional apilimit: number

      Optional splicing number (default: 500/50). The **limit parameter, if there is any, is automatically set to max if this argument has the value of either 500 or 50. It also accepts a unique value like 1, in cases such as list=blocks with a bkip parameter (which only allows one IP to be specified).

    Returns JQueryPromise<(DynamicObject | null)[]>

    Always an array: Elements are either ApiResponse (success) or null (failure). If the multi-value field is an empty array, the return array will also be empty.

    Requires

    mediawiki.api

Generated using TypeDoc