IMDb JSON API by Martin Ivanov

Experimental, free and simple REST API for getting movie, series and artist data from IMDb and returning it as JSON.

This service is not endorsed by or affiliated with IMDb.com.

Getting Data

Get IMDb Data by Resource ID

The resource ID is the part of the IMDb URL in bold, for example: http://www.imdb.com/name/nm0000314.

Open your browser's developer tools and check the response in the console.

http://imdb.wemakesites.net/api/IMDB_RESOURCE_ID

JSONP Example with jQuery

$('form[name="get-data-by-resource-id"]').on("submit", function(e) { var form = $(this); e.preventDefault(); $.ajax({ url: "http://imdb.wemakesites.net/api/" + form.find("select").val(), crossDomain: true, dataType: "jsonp", success: function(data) { window.console.log(data); } }); });

cURL Example with PHP

<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "imdb.wemakesites.net/api/nm0000115"); // Nicolas Cage curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); echo $output; curl_close($ch); ?>

Search IMDb

Open your browser's developer tools and check the response in the console.

http://imdb.wemakesites.net/api/search?q=SEARCH_TERM

JSONP Example with jQuery

$('form[name="search-imdb"]').on("submit", function(e) { var form = $(this); e.preventDefault(); $.ajax({ url: "http://imdb.wemakesites.net/api/search", data: form.serialize(), crossDomain: true, dataType: "jsonp", success: function(data) { window.console.log(data); } }); });

cURL Example with PHP

<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "imdb.wemakesites.net/api/search?q=Nicolas+Cage"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); echo $output; curl_close($ch); ?>

Status Messages

All requests to the API return status, code and message keys along with the retrieved data.

OK ("success", 200)

Status is returned after a successful data retrieval.

{ "status": "success", "code": 200, "message": "ok" }

Not Found ("fail", 404)

Status is returned after an unsuccessful data retrieval, resulted from HTTP 404 on IMDb's servers.

{ "status": "fail", "code": 404, "message": "Resource not found" }

Missing IMDb ID ("fail", 1)

Status is returned if the API is accessed without supplying IMDB_RESOURCE_ID (http://imdb.wemakesites.net/api/IMDB_RESOURCE_ID).

{ "status": "fail", "code": 1, "message": "IMDb ID not set" }