Search code examples
case-sensitivewikipedia-apicapitalization

How to get content from the Wikipedia API for a movie?


I tried to get the description of the movie "Your Highness" from the Wikipedia API but it gives me nothing.

http://en.wikipedia.org/w/api.php?format=xml&action=query&titles=your%20highness&prop=revisions&rvprop=content

When I google "Your Highness" wikipedia shows up as the third result, that's the page that I want the API to give me.

Also I just want the text of the description of the movie, no wiki-syntax mixed in or anything.


Solution

  • I was wrong before about the problem being a space - it looks like it was just capitalization. If we just change your URL to use Your%20Highness instead of your%20highness it works:

    http://en.wikipedia.org/w/api.php?format=xml&action=query&titles=Your%20Highness&prop=revisions&rvprop=content

    EDIT: While not all titles are title-cased (such as "The Name of the Rose") if you use the &redirects query parameter, it sometimes helps - it certainly helps in "the name of the rose" but not for "your highness" for some reason. Wouldn't like to say why, but it's probably worth more investigation...