Hemanth's Scribes

web

Wikipedia Search Summary API

Author Photo

Hemanth HM

Wikipedia Search Summary API

After Random images from wikipedia I made another simple API to get the summary for a search term using PHP.

It’s a JSONP API that queries the DNS of wikipedia to fetch the TXT records, which also includes a short URL to the complete corresponding Wikipedia entry. As cross-domain requests are possible with this API, one can easily integrate it to search boxes or widgets.

Monkey code :

$result[0]['txt'])).')'; ?>

A simple $.getJSON() can be used to get the data.res indeed the famous “callback=?” trick is <3’d by one and all.

SAMPLE RESPONSE with callback=?

You might also like One line GUI wikipedia search

#javascript#linux