find_imdb_id: Retrieve the IMDb Identifier of a Movie

View source: R/find_imdb_id.R

find_imdb_idR Documentation

Retrieve the IMDb Identifier of a Movie

Description

This function tries to retrieve the IMDb identifier of a movie based on a its title and using the OMDb API http://www.omdbapi.com/. User can also specify the release year of the movie. See details below for further informations.

Usage

find_imdb_id(search, year = NULL, n_max = 10, sleep = 0.1, verbose = TRUE)

Arguments

search

A movie title to search for.

year

(optional) The release year of the movie.

n_max

Number of matches to returned (default is 10).

sleep

Time interval between two API requests.

verbose

A boolean. If TRUE, prints some informations.

Details

For better results, you should write the complete movie title with its exact spelling. Results are sorted by their similarity with the search terms.

If you don't find the movie you are looking for, you can visit the IMDb website (https://www.imdb.com) and get this ID from the movie URL. It is always in the form: tt9999999 (only numbers are specific to the movie; the prefix 'tt' is a constant).

For instance, in this URL: https://www.imdb.com/title/tt5699154/, the IMDb ID is 'tt5699154'.

For non-English movies, the English name might be different from the original title. For example, the English title of the french movie "Le Sens de la fĂȘte" (2017) is "C'est la vie!" (IMDb ID = tt5699154).

Only movies are currently implemented.

Value

A data frame with:

  • title: the movie title

  • year: the year of release

  • imdbid: the IMDb ID of the movie

Examples

## Not run: 
find_imdb_id(search = "solo a star wars story")

find_imdb_id("Star Wars", year = 2018, n_max = 20)

## End(Not run)

inSileco/omdbr documentation built on Feb. 12, 2024, 9:34 a.m.