The API uses URLs very similar to the existing stats URLs. Here's an example:
The url parameters start_date and end_date are required and must be dates in YYYY-MM-DD format. To access project-wide stats, use /files/stats/json in the URL. To limit to a file or folder, use /files/some/path/stats/json
The return data is in JSON format. The data should be pretty self-explanatory. A few notes:
- "messages" may contain a list of informational messages, e.g. the date range was adjusted due to out of bounds start/end date
- "period" contains one of daily, weekly, monthly. This is auto-selected based on the size of the date range, and the "downloads" list will contain days, weeks, or months respectively
- "countries" uses full names
- "stats_updated" is a timestamp. Stats have been updated up to that point in time.
- all dates are UTC