Is there any API in Java to access wikipedia data

neha picture neha · Sep 9, 2009 · Viewed 26.3k times · Source

I want to know: is there any API or a query interface through which I can access Wikipedia data?

Answer

Robert Christie picture Robert Christie · Sep 9, 2009

Mediawiki, the wiki platform that wikipedia uses does have an HTTP based API. See MediaWiki API.

For example, to get pages with the title stackoverflow, you call

http://en.wikipedia.org/w/api.php?action=query&titles=Stackoverflow

There are some (incomplete) Java wrappers around the API - see the Client Code - Java section of the API page for more detail.