6 releases
0.3.2 | Jun 9, 2021 |
---|---|
0.3.1 | Oct 2, 2020 |
0.2.1 | Jun 9, 2019 |
0.1.2 | Mar 1, 2017 |
0.1.0 | Jun 22, 2016 |
#976 in Database interfaces
20KB
460 lines
OMDb API for Rust
Search movies, tv shows, and games using The Open Movie Database.
Examples
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);
Usage
Add the crates.io omdb
dependency to your Cargo.toml file.
[dependencies]
omdb = "*"
Dependencies
~4–20MB
~225K SLoC