knitr::opts_chunk$set( message = FALSE, warning = FALSE, fig.retina = 2, collapse = TRUE, comment = "#>", fig.path = "README-" )
omdbapi is an R package wrapper for the Open Movie Database API
NOTE: THE OMDB API NOW REQUIRES AN API KEY https://www.patreon.com/posts/api-is-going-10743518
The following functions are implemented:
find_by_id
: Retrieve OMDB info by IMDB ID searchfind_by_title
: Retrieve OMDB info by title searchget_actors
: Get actors from an omdb object as a vectorget_countries
: Get countries from an omdb object as a vectorget_directors
: Get directors from an omdb object as a vectorget_genres
: Get genres from an omdb object as a vectorget_writers
: Get writers from an omdb object as a vectorsearch_by_title
: Lightweight OMDB title search0.3.0
released (API key support & https URL switch)0.1.0.9000
released0.2.0.9000
released - better types in the data frames and get_
methods to split the fields with multiple entriesdevtools::install_github("hrbrmstr/omdbapi")
options(width=80)
library(omdbapi) library(tidyverse) # current verison packageVersion("omdbapi") search_by_title("Captain America") search_by_title("Star Wars", page = 2) search_by_title("Captain America", year_of_release=2013) games <- search_by_title("Captain America", type="game") glimpse(games) find_by_title(games$Title[1]) find_by_title("Game of Thrones", type="series", season=1, episode=1) get_genres(find_by_title("Star Trek: Deep Space Nine", season=5, episode=7)) get_writers(find_by_title("Star Trek: Deep Space Nine", season=4, episode=6)) get_directors(find_by_id("tt1371111")) get_countries(find_by_title("The Blind Swordsman: Zatoichi"))
ichi <- search_by_title("Zatoichi") pb <- progress_estimated(length(ichi$imdbID)) zato <- purrr::map_df(ichi$imdbID, find_by_id) zato
ggplot(zato, aes(x="IMDB Rating", imdbRating)) + geom_boxplot() + scale_y_continuous(limits=c(0,10)) + coord_flip() + labs(x=NULL, y=NULL, title="Distribution of IMDB Ratings for Zatoichi movies") + hrbrthemes::theme_ipsum_rc(grid="X")
library(omdbapi) library(testthat) date() test_dir("tests/")
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.