User:Kunalkapoor/sandbox

Introduction
The Open Movie Database (OMDb API) provides an easy web interface to access information of online media content referenced on IMDb. It provides a simple web service that responds to HTTP GET requests and returns the search results in either JSON or XML. The API can be used to search for movies, series and episodes using keywords or clues like name, type and year of release. It can also provide a detailed result for a particular movie, series or episode outputting interesting aspects about the media like the plot, Rotten Tomatoes ratings and others.

The web service also provides a Poster API that returns an image of the poster of the media requested. The API also provides a monthly database dump of media which users can subscribe to. These features are only for users that have donated to the website and is currently in closed beta.

Usage
There are two ways to get the data using OMDb API first is by using IMDb ID or movie title and other is by using search string. To use the OMDb API send the HTTP GET request using this link http://www.omdbapi.com/ by adding parameter mentioned in below table.

By ID or Title
In this method you need to provide the ID or title to get the JSON /XML response. After the request is sent, a detailed response for that particular IMDb ID or response with the closest match to title will be returned. If there is no match for title or ID, a response with "Movie not found" error will be returned.

By Search
In this method you can search the database using a search string and a list of movies matching the search string will be returned as the response. If no match is found for the search string then a "Movie not found" error will be returned.

By ID or Title
The simplest search by title can be the following: http://www.omdbapi.com/?t=the%20matrix&tomatoes=true It returns a JSON result which contains details on the movie The Matrix along with its rating on Rotten Tomatoes. When parsed into a readable format the output looks like below:

A more detailed example would be : http://www.omdbapi.com/?t=stargate&type=series&season=1&r=xml This returns the details of Season 1 of the TV series, Stargate SG-1 (the closest name to stargate given in the parameter) in an XML format.

By Search
A simple search argument would be: http://www.omdbapi.com/?s=matrix This results in a list of different types of media with that name.

Poster API
Searching through the poster API requires a key which is obtained by donating to the developer. A simple search is done by the following GET request which looks similar to the requests shown in the above examples. http://img.omdbapi.com/?apikey=&#x5B;key&#x5D;&t=frozen This returns the poster for the movie Frozen. File:Frozen (2013 film) poster.jpg

Ruby Wrapper
Several ruby gems are available to access the OMDb API like omdb, omdbapi. A simple code of how to use omdbapi gem is shown below:

Python Wrapper
omdb.py is the python wrapper for OMDb API. Simple code to use this wrapper is shown below:

R Wrapper
There is a R package to access OMDb API. Simple code to use this package is shown below:

Other tools
There are several other tools on the web that perform the same or similar operation of exposing media details to a user. A preliminary list of these can be found below.
 * Rotten Tomatoes API
 * IMDB We Make Sites
 * Movie Poster Db
 * My API Films
 * Cinemalytics