How To Use the IMDb API (2021) [Tutorial] | RapidAPI (2024)

IMDb Database

IMDb stands for the Internet Movie Database and is a massive online website directory housing tons of information related to films, TV programs, video games, internet streams and more.

For each media listing, IMDb also contains data about the relevant cast, directors, producers, plot summaries, trivia, movie quotes, fan reviews, and ratings.

Much of IMDb’s data is collected through their users and their user-generated content.

View the Best IMDB APIs List

Where could I find an API to access IMDb data?

There are many IMDb-alternatives (like TMDb & OMDb) and open movie database app scraping APIs out there that access IMDb’s massive database to help you gain insight into their data.

These APIs and web services are perfect for helping you build the perfect website, mobile application, or software.

Does IMDb have an API?

IMDb does officially have a public API called Search Suggestions, but it is undocumented. The Search Suggestions API has a JSON-P format that cannot be customized. Read more at StackOverflow.

You can also try screen scraping the IMDb website for its dataset, but that requires a lot of effort.

For a more comprehensive API, check out the Movie Database (IMDb Alternative) Open API on RapidAPI.

Connect to API

In this blog post, we’ll cover the API, its endpoints and functionalities.

Other IMDb APIs

  • IMDb – IMDb API helps to query for all information about films, actors, characters, etc… as on official websites.
  • IMDb-API – The IMDb-API is a web service for receiving movies, serial, and cast information. APIs results are a JSON and includes items such as movie specifications, images, posters, trailers, ratings, Wikipedia page content, and more.
  • Entertainment Data Hub – The API provides a powerful search of movies, games and TV series using multiple filters including availability on streaming services, year of release, ratings, and more.
  • IMDB – Internet Movie Database Unofficial– Fetch film data and search results from IMDB
  • Netflix Unofficial – Netflix unofficial API. Bringing all the data of the films, with various forms of search, including the rating on IMDB.
  • See more here
  • See top movie APIs here

Movie Database API – an IMDb Movie API

The Movie Database API the perfect solution if you’re a developer in need of an API to retrieve IMDb data.

The Movie Database API has two GET endpoints (no POST options):

  • Search
  • ID or Title

Search

This endpoint allows you to search movie and TV shows by title. The API returns a list of movie or TV show results based on your search query. The optional parameters include:

  • page – return results by page (1-100)
  • y – specify the year of release
  • r – specify the result format (JSON or XML)
  • type – specify the type of result to return. The three options include movie, series or episode

Here’s a sample JSON response for a query of “Avengers Endgame”:

{ "Search":[ { "Title":"Avengers: Endgame", "Year":"2019", "imdbID":"tt4154796", "Type":"movie", "Poster":"https://m.media-amazon.com/images/M/MV5BNGZiMzBkZjMtNjE3Mi00MWNlLWIyYjItYTk3MjY0Yjg5ODZkXkEyXkFqcGdeQXVyNDg4NjY5OTQ@._V1_SX300.jpg" } ], "totalResults":"1", "Response":"True"}

For each JSON item, the API returns:

  • Title
  • Release Year
  • IMDb ID
  • Type (movie, series, or episode)
  • Movie Poster image

ID or Title

This endpoint will return more detailed results about a specific title you have in mind (IMDb ID or movie title required).

The optional parameters include:

  • callback – JSONP callback name
  • i – IMDb ID
  • type – Type of result to return: (movie, series, episode)
  • r – Data type to return (JSON or XML)
  • plot – Choose short or full summary (short, full)
  • y – Year of release

Let’s take the IMDb ID (tt4154796) from the earlier “Avengers Endgame” response and plug it into this endpoint. Here is the response from our fetch:

{ "Title":"Avengers: Endgame", "Year":"2019", "Rated":"N/A", "Released":"26 Apr 2019", "Runtime":"N/A", "Genre":"Action, Adventure, Fantasy, Sci-Fi", "Director":"Anthony Russo, Joe Russo", "Writer":"Christopher Markus, Stephen McFeely, Stan Lee (based on the Marvel comics by), Jack Kirby (based on the Marvel comics by), Jim Starlin (comic book)", "Actors":"Bradley Cooper, Brie Larson, Chris Hemsworth, Chris Evans", "Plot":"After the devastating events of Avengers: Infinity War (2018), the universe is in ruins. With the help of remaining allies, the Avengers assemble once more in order to undo Thanos' actions and restore order to the universe.", "Language":"English", "Country":"USA", "Awards":"N/A", "Poster":"https://m.media-amazon.com/images/M/MV5BNGZiMzBkZjMtNjE3Mi00MWNlLWIyYjItYTk3MjY0Yjg5ODZkXkEyXkFqcGdeQXVyNDg4NjY5OTQ@._V1_SX300.jpg", "Ratings":[ ], "Metascore":"N/A", "imdbRating":"N/A", "imdbVotes":"N/A", "imdbID":"tt4154796", "Type":"movie", "DVD":"N/A", "BoxOffice":"N/A", "Production":"Marvel Studios", "Website":"N/A", "Response":"True"}

You can see that this function has a much more comprehensive result that includes:

  • Title
  • Release Year
  • Rating
  • Release Date
  • Runtime
  • Genre(s)
  • Director(s)
  • Writer(s)
  • Actor(s)
  • Plot Summary
  • Language(s)
  • Country/Countries
  • Awards Won
  • Movie posters (URL of film image)
  • Ratings received
  • Metascore
  • IMDb Rating
  • IMDb Votes
  • IMDb ID
  • Type (movie, series, or episode)
  • DVD info
  • Box Office results
  • Production company
  • Website(s)

Connect to API

How to start using the IMDb API

  1. Sign up for a RapidAPI user account (it’s free).
  2. Navigate to the API pricing page and subscribe to a pricing plan. Hint: There’s a free tier that allows up to 1,000 requests per day.
  3. Return to the IMDb API documentation & endpoints page.
  4. Pick one of the IMDb API endpoints and select your preferred programming language (method of code) from the dropdown. The IMDb API can be used with Node.js, PHP, Python, Ruby, Objective-C, Java (Android), C# (.NET), and cURL.
  5. Fill out all required parameters (and any optional parameters if you like).
  6. Click “Test Endpoint” to test the API right in your browser.
  7. Copy the “Request Snippet” and integrate right into your website or application.

RapidAPI has many SDKs available to help you access the many APIs on the RapidAPI marketplace.

For the IMDb API, we have the following available programming languages:

  • NodeJS
  • PHP
  • Python
  • Ruby
  • Java
  • Objective-C
  • .NET
  • cURL

Connect to API

How to use IMDb API with Node.js

  1. Install unirestnpm module
    $ npm install unirest
  2. Pick any IMDb API endpoint & select “NodeJS” under “Request Snippet”.How To Use the IMDb API (2021) [Tutorial] | RapidAPI (1)
  3. Copy snippet & make the request
    var unirest = require('unirest');unirest.post(API_URL) .header("X-RapidAPI-Key", API_KEY) .end(function (result) { console.log(result.status, result.headers, result.body); });

Read more about the node.js unirest SDK here.

Related: How to use the IMDb API with React

Connect to API

How to use IMDb API with PHP

Requirements:

  • cURL
  • PHP 5.4+
  1. Install unirest-php with Composer or from source.
    • With Composer:
      { "require-dev": { "mashape/unirest-php": "3.*" }}
    • Install from Source:
      require_once '/path/to/unirest-php/src/Unirest.php';
  2. Choose any API endpoint and select “PHP” from the drop down to get the request snippet.
  3. Create a request with the selected API endpoint snippet:
    $headers = array('Accept' => 'application/json');$response = UnirestRequest::post("API_URL", array( "X-RapidAPI-Key" => "API_KEY" ));

Connect to API

How to use IMDb API with Python

  1. Install Unirest for Python using pip:
    $ pip install unirest
  2. Select any IMDb API endpoint & select “Python” from the drop down to copy the request snippet.
  3. Make the request by importing unirest:
    import unirestresponse = unirest.post(API_URL, headers={ "X-RapidAPI-Key": API_KEY, "Content-Type": "application/x-www-form-urlencoded" }, params={ "parameter": "value" })response.code # The HTTP status coderesponse.headers # The HTTP headersresponse.body # The parsed responseresponse.raw_body # The unparsed response

Connect to API

See a more detailed tutorial on how to use the IMDb API with Python.

How to use IMDb API with Ruby

Requirements:Ruby >= 2.0

  1. Install the unirest gem:
    gem install unirest
  2. From the IMDb API endpoints page, select “Ruby” from the drop down to get the request snippet.
  3. Make a request by requiring unirest:
    require 'unirest'response = Unirest.post API_URL, headers:{ "X-RapidAPI-Key" => API_KEY, "Content-Type" => "application/x-www-form-urlencoded" }, parameters:{ "parameter" => "value" }response.code # Status coderesponse.headers # Response headersresponse.body # Parsed bodyresponse.raw_body # Unparsed body

Connect to API

Learn more here.

How to use IMDb API with Java

  1. Include the unirest library with or without Maven.
  2. Select any API endpoint and choose “Java” from the request snippet drop down to get the request snippet.
  3. Make a request:
    HttpResponse response = Unirest.post(API_URL).header("X-RapidAPI-Key", API_KEY).queryString("parameter", "value").field("parameter", "value").asJson();

Connect to API

How to use IMDb API with Objective-C

Requirements:The Unirest-Obj-C client library requires ARC (Automatic Reference Counting) to be enabled in your Xcode project.

  1. Download the Objective-C Unirest Library.
  2. Get the Objective-C request snippet from any API endpoint.
  3. Make the request:
    #import <UNIRest.h>NSDictionary *headers = @{@"Authorization": @"", @"X-RapidAPI-Key": @API_KEY, @"Content-Type": @"application/x-www-form-urlencoded"};UNIUrlConnection *asyncConnection = [[UNIRest post:^(UNISimpleRequest *request) { [request setUrl:@API_URL]; [request setHeaders:headers];}] asJsonAsync:^(UNIHTTPJsonResponse *response, NSError *error) { NSInteger code = response.code; NSDictionary *responseHeaders = response.headers; UNIJsonNode *body = response.body; NSData *rawBody = response.rawBody;}];

Connect to API

How to use IMDb API with .NET

  1. Download the unirest-net libraryand reference it in your project:
  2. On any IMDb API endpoint, select “.NET” from the drop down to get the request snippet.
  3. Make the request:
    Task<HttpResponse<MyClass>> response = Unirest.post(API_URL).header("X-RapidAPI-Key", API_KEY).header("Content-Type", "application/x-www-form-urlencoded").asJson();

Connect to API

How to use IMDb API with cURL

  1. From an endpoint, select “cURL” from the request snippet dropdown.
  2. Make the request:
    curl --get --include 'API_URL' -H 'X-RapidAPI-Key'

Bonus: How to use the IMDb API with Google Sheets

If you want to learn how to interact with the IMDb API in spreadsheet form, then you might be interested in the RapidAPI Google Sheets plugin.

Quick Links:

Steps

  1. Activate the RapidAPI Google Sheets Add-On.
  2. Visit this Google Sheet Template. This is a view-only template, so make a copy by navigating to File > Make a Copy.
  3. Now insert your API Key from RapidAPI in the “Insert API Key:” fields.

And now you’re all set up!

This template has 2 tabs: 1 for Search and 1 for data extraction given an imdbID.

Try playing with the “Search Query” and “imdbID” fields to produce different results.

Edit the GET parameter for more advanced results. If you have any questions feel free to comment on them in this blog post.

How do you apply for an IMDb API Key?

After signing up for a free RapidAPI account and subscribing to a pricing plan on the IMDb pricing page (remember, there’s a free version), you’ll be automatically assigned an API key with your application.

Connect to API

Is the IMDb API free?

Yes, the IMDb API has a free version that provides a limit of 1,000 API requests per day. If you need more usage, you can subscribe to the paid pricing plans.

IMDb API Pricing

BasicProUltraMega
Price$0.00/Month$1.00/Month$5.00/Month$10.00/Month
Requests1,000/Day100,000/Day250,000/DayUnlimited
Cost per additional request$0.01$0.005$0.001None

The IMDb API has 4 pricing tiers:

  • Basic – freemium version that allows 1,000 requests per day. Additional requests cost $0.01 per call.
  • Pro – $1/month that guarantees you 100,000 requests per day.
  • Ultra – $5/month for 250,000 requests per day.
  • Mega – $10/month for unlimited requests.

Related Links

View the Best IMDB APIs List

4.8/5 - (26 votes)

How To Use the IMDb API (2021) [Tutorial] | RapidAPI (2024)
Top Articles
Latest Posts
Article information

Author: Mr. See Jast

Last Updated:

Views: 6194

Rating: 4.4 / 5 (75 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Mr. See Jast

Birthday: 1999-07-30

Address: 8409 Megan Mountain, New Mathew, MT 44997-8193

Phone: +5023589614038

Job: Chief Executive

Hobby: Leather crafting, Flag Football, Candle making, Flying, Poi, Gunsmithing, Swimming

Introduction: My name is Mr. See Jast, I am a open, jolly, gorgeous, courageous, inexpensive, friendly, homely person who loves writing and wants to share my knowledge and understanding with you.