Page MenuHomePhabricator

REST API pageviews won't fetch / incorrectly fetching using URL
Closed, ResolvedPublic

Description

Can't get any requests to work on the built in tool at https://wikimedia.org/api/rest_v1/#/

Steps to produce:

  1. go to https://wikimedia.org/api/rest_v1/#/
  2. expand pageviews data
  3. click Try it out
  4. use the following parameters: en.wikipedia.org all-access all-agents dubstep daily 20200101 20200901
  5. click execute

Expected Result:
A report of all views on the Dubstep page from January to September

Actual Result:
When clicking Execute, the feedback from the server says

TypeError: Failed to fetch

If I instead use the URL provided (below) I only get two entries with erroneous views in February and March

https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/en.wikipedia.org/all-access/all-agents/dubstep/daily/20200101/20200901

Event Timeline

Onedaytheywokemeup renamed this task from REST API pageviews won't fetch / incorrectly fetch using URL to REST API pageviews won't fetch / incorrectly fetching using URL.Sep 12 2020, 4:28 PM
Onedaytheywokemeup updated the task description. (Show Details)

Hi @Onedaytheywokemeup , thanks for reporting :)
I can't reproduce TypeError: Failed to fetch using the API doc.
I However confirm the returned result is not the expected one for the Dubstep page, due to the missing capital D in Dubstep in the query:

https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/en.wikipedia.org/all-access/all-agents/dubstep/daily/20200101/20200901

vs

https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/en.wikipedia.org/all-access/all-agents/Dubstep/daily/20200101/20200901

We'll investigate more as to how there can be pageviews for an article that doesn't exist (dubstep without capital).
Thanks again

Closing, working fine as long as title matches case wise and project is expressed like es.wikipedia .. etc