Today I had some fun creating a Wikidata search plugin for Firefox, and a similar extension for Chrome.
The Chrome extension
The Chrome extension adds search capabilities in the “omnibox”, which is what the url bar is called nowadays. (At least in Chrome – Firefox has an “awesome bar”.) When trying “wd”, followed by a tab or space, you can then type a search term, and up to 3 suggestions will be shown. In the screenshot above “Wikipedia” is entered as search term.
Only items are searched against, and only their English labels and descriptions. The suggestions shown are the English label, plus a description, if one is available for the item. The obvious next step to take is allowing searching in multiple languages.
I had some “fun” trying to find out why the HTTP request I was making to the API was returning something weird. After half an hour or so it occurred to me the extension might not have sufficient rights, and indeed, this turned out to be the culprit. Some helpful error in the result would have been nice!
The Firefox plugin
This plugin was very simple to create. It’s just an OpenSearch XML file. When installed, it allows you to select “Wikidata” as search engine in the Firefox search field. When searching, you will get the same results as when entering the search terms in the wikidata.org search field. Currently the suggestions for this search engine are not working. This is due to the OpenSearch support of wikidata.org being broken, something I discovered while writing this plugin.