Crates.io | omdb |
lib.rs | omdb |
version | 0.3.2 |
source | src |
created_at | 2016-06-22 23:24:54.989834 |
updated_at | 2021-06-09 00:16:00.974784 |
description | OMDb API for Rust |
homepage | https://github.com/aldrio/omdb-rs |
repository | https://github.com/aldrio/omdb-rs |
max_upload_size | |
id | 5463 |
size | 20,116 |
Search movies, tv shows, and games using The Open Movie Database.
Find by title:
let show = omdb::title("The Wizard of Oz")
.apikey(APIKEY)
.year(1939)
.get()
.await
.unwrap();
assert!(show.imdb_id == "tt0032138");
Find by IMDb ID:
let movie = omdb::imdb_id("tt0111161")
.apikey(APIKEY)
.get()
.await
.unwrap();
assert!(movie.title == "The Shawshank Redemption");
Search movies:
use omdb::Kind;
let movies = omdb::search("batman")
.apikey(APIKEY)
.kind(Kind::Movie) // Optionally filter results to movies only
.get()
.await
.unwrap();
assert!(movies.total_results > 0);
Add the crates.io omdb
dependency to your Cargo.toml file.
[dependencies]
omdb = "*"