Thanks very much, and well spotted, Petr! I didn't notice.

Regards,
        Mark

-----Original Message-----
From: mediawiki-api-boun...@lists.wikimedia.org 
[mailto:mediawiki-api-boun...@lists.wikimedia.org] On Behalf Of Petr Onderka
Sent: 16 August 2012 13:24
To: MediaWiki API announcements & discussion
Subject: Re: [Mediawiki-api] Wikipedia external links API missing expected 
results

If you look at http://en.wikipedia.org/wiki/Neils_Bohr,
you'll notice that it's not the actual article, it's a redirect:

> (Redirected from Neils Bohr)

The actual article name (and the correct name of the physicist) is Niels Bohr.
And, as expected

https://en.wikipedia.org/w/api.php?action=query&titles=Niels%20Bohr&prop=extlinks&ellimit=max

shows you the external links.
Or, if you want to work with redirects, you can add "redirects" to your query 
and it will work even with the incorrect name:

https://en.wikipedia.org/w/api.php?action=query&titles=Neils%20Bohr&prop=extlinks&ellimit=max&redirects

Petr Onderka
[[en:User:Svick]]

On Thu, Aug 16, 2012 at 2:05 PM, Mark Robson <mark.rob...@kaspersky.com> wrote:
> Hi,
>
>
>
> I’m trying to get the list of external links on pages.
>
>
>
> I can do this with the API query command, thus:
>
>
>
> https://en.wikipedia.org/w/api.php?action=query&titles=Barack%20Obama&;
> prop=extlinks&ellimit=max
>
>
>
> In this case, requesting Barack Obama’s links.
>
>
>
> Also it works well with Einstein:
>
>
>
> https://en.wikipedia.org/w/api.php?action=query&titles=Albert%20Einste
> in&prop=extlinks&ellimit=max
>
>
>
> However, another famous physicist, Neils Bohr, gives me nothing, even 
> though looking at his article, there are several external links.
>
>
>
> https://en.wikipedia.org/w/api.php?action=query&titles=Neils%20Bohr&pr
> op=extlinks&ellimit=max
>
>
>
> Do you know why this is? Is it a bug?
>
>
>
> Regards
>
>                Mark
>
>
> _______________________________________________
> Mediawiki-api mailing list
> Mediawiki-api@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
>

_______________________________________________
Mediawiki-api mailing list
Mediawiki-api@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
_______________________________________________
Mediawiki-api mailing list
Mediawiki-api@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api

Reply via email to