Use Wikipedia API to get the most read articles within a certain time range?

Viewed 1351

Given some integer n and a date d, I'd like to use the Wikipedia API to obtain the n most viewed articles in the time between d and the current date. Is this possible, and if so, how?

What I have tried so far is the following:

  1. Use https://wikimedia.org/api/rest_v1/metrics/pageviews/top/en.wikipedia/all-access/2017/05/01 . The problems with this approach are that firstly, this seems to support no other value than n = 1000 and secondly, it aggregates views only for a single day and not an arbitrary time range.

  2. Use the query action with list allpages (i.e. https://en.wikipedia.org/w/api.php?action=query&format=json&list=allpages) to obtain all articles, but I do not know how to filter the result such that only the most viewed articles are included.

I also checked https://stats.wikimedia.org/ but didn't find anything helpful there.

1 Answers
Related