omdb

Crates.ioomdb
lib.rsomdb
version0.3.2
sourcesrc
created_at2016-06-22 23:24:54.989834
updated_at2021-06-09 00:16:00.974784
descriptionOMDb API for Rust
homepagehttps://github.com/aldrio/omdb-rs
repositoryhttps://github.com/aldrio/omdb-rs
max_upload_size
id5463
size20,116
Brandon Aldrich (aldrio)

documentation

https://docs.rs/crate/omdb

README

OMDb API for Rust

Build Status crates.io docs.rs

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 = "*"

Commit count: 48

cargo fmt