Page MenuHomePhabricator

[Spike 2 days] Recommended Content APIs
Closed, ResolvedPublic3 Estimated Story PointsSpike

Description

We are beginning work now on investigating inter-article recommendations, as part of our work with the WikiExperiences 3.1 OKR (reference). For this, we should look into APIs we can use that will link between wiki articles, so we can get a better sense of what information is available, who owns these APIs, and roughly how ready they would be to use.

Question we are trying to answer

    • Look into the various APIs that currently offer :
  • Nearby
  • Morelike (currently used in Related Articles), part of CirrusSearch
  • Pageviews data (high moderation risk here, would probably need some sort of separate moderation workflow)
    • total, total per country, and access method
  • Edited pages data (medium/high moderation risk)
    • Most edited, top 100 edited, top 100 edited per net bytes difference, top 100 edited per absolute bytes
  • Mediarequests???
  • Most requested media
  • Feed Content Availability??
  • MediaWiki API
    • Because you read
  • Rest API (Top Read, In the News, Today on Wikipedia, On this Day)
  • Wikidata APIs?

Acceptance Criteria

  • We have researched available APIs in this space
  • We have produced a table listing potential APIs, a description of what they do, endpoints to hit, risks in using them, audience (logged in/logged out), and owner (team)

Event Timeline

ovasileva triaged this task as Medium priority.Jul 11 2024, 5:39 PM
ovasileva updated the task description. (Show Details)
ovasileva renamed this task from [Spike] Recommended Content APIs to [Spike 16 hours] Recommended Content APIs.Jul 11 2024, 5:43 PM
ovasileva renamed this task from [Spike 16 hours] Recommended Content APIs to [Spike 2 days] Recommended Content APIs.
ovasileva set the point value for this task to 3.
ovasileva raised the priority of this task from Medium to High.Jul 15 2024, 2:30 PM
JTannerWMF added subscribers: cooltey, Seddon, JTannerWMF.

Just wanting to follow along, let us know if we can contribute to this research

Hi, we can share some of our experiences from the Apps team 👋

Feel free to grab any information into the final spike.

Rest API (Top Read, In the News, Today on Wikipedia, On this Day)

Description
A Rest API that outputs the top read, in the news, the featured article, on this day, and the featured image.

URL
https://en.wikipedia.org/api/rest_v1/feed/featured/2024/07/17

Risk

  • The API does not fully support all languages, for example, in the Japanese wiki, the same date (2024/07/17) will only have three types available (the featured article, the top read, and the featured image).
  • Incorrect language variants on page titles in Chinese Wikipedia, and might be happened in other wikis that have language variants. See detail: T355192
  • Will get an empty response when the date is changed. For example, 17:00 PT = 00:00 UTC, and it will be considered as a date change on the server side.

Audience
Logged in + logged out.

Owner
https://www.mediawiki.org/wiki/API:REST_API


Feed Content Availability

Description
An endpoint that helps to check what types of feed items are available in a certain wiki.

URL
https://en.wikipedia.org/api/rest_v1/feed/availability

Risk
None

Audience
Logged in + logged out.

Owner
https://www.mediawiki.org/wiki/API:REST_API


Morelike

Description
An endpoint that lists the related articles with a search namespace morelike:

URL
https://en.wikipedia.org/w/api.php?action=query&format=json&generator=search&formatversion=2&gsrsearch=morelike%3AUnited_States

Risk

  • Incorrect language variant on page titles in the Chinese wiki, will need to request another endpoint (e.g. /page/summary/) to get the correct page title.
  • The page/related REST endpoint has a slow response time in the Chinese wiki. See detail: T271145

Audience
Logged in + logged out.

Owner
https://www.mediawiki.org/wiki/Extension:CirrusSearch
https://www.mediawiki.org/wiki/API:REST_API (page/realted)

KSarabia-WMF removed ovasileva as the assignee of this task.
KSarabia-WMF added a subscriber: ovasileva.
KSarabia-WMF subscribed.

Looks great, thanks @KSarabia-WMF !
I made up https://phabricator.wikimedia.org/T371287 to add a few more APIs but this is a great summary of what's available now.