Contact us at 214.516.5659 or furor6933@gmail.com

Interview Wikipedia API

Interview Wikipedia API

Interview Project

During one of my project interviews I was asked to build a simple app that could connect to the Wikipedia API and display relevant results in a custom styled page using a search query they provided. Most people have heard of Wikipedia: The crowd-sourced knowledge, covering almost every subject you can think of and available to anyone with a web browser. Regardless of what information you seek, you can find it on Wikipedia, often in exhaustive detail. And because it’s publicly editable, it always contains updated and relevant information.

Hidden behind the scenes is a strong web service API, which I’d never heard of nor did I know anything about accessing it.

Soon I found myself faced with problem and less than 24hrs to turn the project in.

The Problem

When the user searches for a specific term, the server retrieves information from the following wikipedia API query:
“https://en.wikipedia.org/w/api.php?action=opensearch&format=json&redirects=return&search=” + term

The Solution

I did a bit of research and finally came across a solution on Stackoverflow. It turned out I was creating the variable JSONSite, then not actually using it to get my getJSON call. Second, the wikipedia api needs to have “&callback=?” in the url for it to work properly. Without the &callback=? my custom built JSON would never function. Now although I wasn’t able come up with a solution myself, I did know where to look. You’re not always going to have the answer to every problem, but a good Designer/Developer knows how to use his resources to research and find the best solution to meet their needs.

You can preview my Wiki API here

wiki