Page MenuHomePhabricator

Add option to output "iwurl" (interwiki target url) attribute in ApiQuery
Closed, ResolvedPublic

Description

Please return the target url if a title contains an interwiki prefix like prop=langlinks&llurl=1 does.

At the momment it it not always possible to know the target url of an interwiki link. For language links llurl can be used which solves the problem. /api/query/interwiki only contains the interwiki prefix (@iw) without an possibility to request the url. Not all prefix are contained in the sitematrix (see bug 28743 / bug 19838), so there is no other sure possibility the build the url of the interwikitarget by your own.

My suggestion would be to add a new parameter interwikiurl, so that http://de.wikipedia.org/w/api.php?action=query&titles=en:Main%20Page&redirects=&interwikiurl=1
returns
<api>

<query>
  <interwiki>
    <i title="en:Main Page" iw="en" iwurl="http://en.wikipedia.org/wiki/Main Page"/>
  </interwiki>
</query>

</api>

New the iwurl attributes should return the same value like /api/query/pages/page/langlinks/ll/@url on querying prop=langlinks&url=1


Version: unspecified
Severity: enhancement

Details

Reference
bz29237