The root is `https://tools.wmflabs.org/mediaplaycounts/api`. The current version is 1. The version number will increase as backwards-incompatible changes are made. As such, this is the documentation for version 1, located at `https://tools.wmflabs.org/mediaplaycounts/api/1`.
As with most trendy web APIs, parameters are sequential (i.e. the key is implied) and separated by forward slashes.
The FilePlaycount group of methods returns metrics on a single Commons file. For the `filename` parameter, you should not include the `File:` prefix. You can use spaces or underscores in filenames. The `date` parameter and its variants `start_date` and `end_date` must take the format `YYYYMMDD`.
A shortcut for a `date_range` lookup for the last 30 days, starting with yesterday and going back for a total of 30 days of data. Note that this function will not work until the initial ingest of data into the database is complete.
A shortcut for a `date_range` lookup for the last 90 days, starting with yesterday and going back for a total of 90 days of data. Note that this function will not work until the initial ingest of data into the database is complete.
The CategoryPlaycount group of methods returns metrics for a category of Commons media files, traversing subcategories up to a defined depth. Each method within this group of methods allows you to define the subcategory depth optionally as the last parameter; if it is not included it will default to 9.
Returns play counts for all the files in a category on a given date, including subcategories. The depth of traversal can be optionally included as a last parameter but defaults to 9.
Returns play counts for a category of files, including subcategories, up to a defined depth, through a range of dates, inclusive. The start date must be chronologically earlier than the end date. The depth of traversal can be optionally included as a last parameter but defaults to 9.
A shortcut for a `date_range` lookup for the last 30 days, starting with yesterday and going back for a total of 30 days of data. Note that this function will not work until the initial ingest of data into the database is complete.
A shortcut for a `date_range` lookup for the last 90 days, starting with yesterday and going back for a total of 90 days of data. Note that this function will not work until the initial ingest of data into the database is complete.
Returns a list of media files in a single category. **This does not traverse subcategories**. For the purposes of this method, a "media file" is a video or a sound recording; basically anything with a "play" button.