Hemanth's Scribes

web

Wikipedia Search Summary API

Author Photo

Hemanth HM

Thumbnail

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
Author Photo

About Hemanth HM

Hemanth HM is a Sr. Machine Learning Manager at PayPal, Google Developer Expert, TC39 delegate, FOSS advocate, and community leader with a passion for programming, AI, and open-source contributions.