Generates a function which makes a request to wikimedia.org/api/rest_v1/. This generator is primarily intended for internal use, but can theoretically be used by others to write custom Wikimedia REST API queries.

wx_query_api(reqs_per_second = 200)

Arguments

reqs_per_second

maximum requests allowed per second (default 200)

Value

A rate-limited function with parameters:

path

path after endpoint; e.g. /registered-users/new/{project}/{granularity}/{start}/{end}

endpoint

/metrics by default but can be changed to /feed (for example)

The generated function, when run, processed the JSON response and returns a list. It is up to the user of this generator to turn the results into a data frame or another object.

License

Data retrieved from the API endpoint is available under the CC0 1.0 license.