Topic on User talk:Magnus Manske

Jump to navigation Jump to search

Pulling pageview data on a collection

5
Ethanholda (talkcontribs)

Hi Magnus. I am putting together some dashboards for the Cleveland Museum of Art's wikimedia content, and I was hoping you could point me in the right direction. I've been looking through the BaGLAMa2 code to see if I can figure out how to pull the data I'm looking for (overall pageviews over time and most viewed artwork pageviews...similar to the content here. The wikimedia REST API doesn't seem to have a 'collection' parameter and I haven't figured out if this is info I can pull from another source. Any advice would be appreciated.

Magnus Manske (talkcontribs)

Hi Ethanholda, what I do in BaGLAMa2 is (1) to get all files in a category tree (you can use PetScan for that), (2) get the pages on all wikis that use it, and (3) get the page views for these. (3) is done with the REST API, one page/month at a time. This is slow, painful, and error-prone, but we have to work with what the WMF gives us.

Ethanholda (talkcontribs)

Very good. Thanks. That was the process I was pondering when I thought "there's got to be an easier way"...but I guess not. Best, Ethan

Ethanholda (talkcontribs)

Hello again Magnus. In trying to replicate this, the API keeps telling me there's no data for my query, i.e. "The date(s) you used are valid, but we either do not have data for those date(s), or the project you asked for is not loaded yet."


Is there something wrong with this API call?

https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/en.wikipedia.org/all-access/user/Giovanni%20Battista%20Piazzetta%20-%20The%20Supper%20at%20Emmaus%20-%201931.245%20-%20Cleveland%20Museum%20of%20Art.tiff/daily/20190101/20190901

Magnus Manske (talkcontribs)

You're missing the File: namespace. Anyway, that will only tell you how many people looked at the file description page on English Wikipedia, not at the image embedded in articles.

Reply to "Pulling pageview data on a collection"