Page MenuHomePhabricator

redirect not provided in the query API
Closed, InvalidPublic

Description

example API call where the actual redirect is given empty instead of "Thessaloniki"
https://en.wikipedia.org/w/api.php?action=query&continue=&format=xml&prop=revisions|info&titles=Salonica&rvprop=ids|content|timestamp|user|userid

<page _idx="13441713" ... redirect="">

while it should be

<page _idx="13441713" ... redirect="Thessaloniki">

is this a bug or is there another way to get the redirect target filled correctly?

Event Timeline

Anomie subscribed.

The "redirect" property you are looking at is not intended to contain the target of the redirect, it is simply a flag indicating that the page is a redirect.

You can use the redirects query parameter to have redirects be automatically resolved. For a request to add the redirect target to prop=info, see T31115: add redirect target value on page info (ApiQueryInfo).