Ok, this should be a childlishy easy task but I really can't find an answer for that. I want to make a Java application that would search wikipedia (with a given search query) and return a link to the most relevant article. Simple as that. I don't want to edit the content, parse through, export internal/external links. I just want it to return a link to the searched article. I have been browsing through Wikipedia API and found this action that should be helpful:
http://www.mediawiki.org/wiki/API%3AQuery
But it doesn't return a link. And I don't know how can I form a link using the Page ID. Maybe I need to ask another thing?
I feel stupid to ask this but really I can't get a straight answer from the tons of possibilities Wiki API offers.
Query of the form http://en.wikipedia.org/w/api.php?action=query&title=<query> returns titles of the pages (among other things). http://en.wikipedia.org/wiki/<title> is your link to the page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With