This is actually a bit complicated. If you have the title of an article,
like "Earth", you would want to do an API query like:
https://en.wikipedia.org/w/api.php?action=query&titles=Earth&redirects&prop=pageprops

You would then need to check 3 different things in the result:
1. Is the page in the main namespace ("ns": 0)?
2. Is the page a redirect? See
https://en.wikipedia.org/w/api.php?titles=!&redirects&action=query&prop=pageprops
for an example.
3. Is the page a disambiguation page (pageprops.disambiguation)? See
https://en.wikipedia.org/w/api.php?titles=Georgia&redirects&action=query&prop=pageprops
for an example.

On Thu, Sep 1, 2016 at 11:57 PM, Abdulfattah Safa <[email protected]>
wrote:

> Hi,
>
> How to check if a Wikipedia page is article or not using the API?
>
> --
> Regards,
> Abdulfattah Safa
> Senior Software Engineer
> Mobile: (+972)(599)231600
> Skype: fattah.safa
>
> *P **Please consider the environment before printing this email*
> _______________________________________________
> Wikitech-l mailing list
> [email protected]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to