#api #client #tmdb

tmdb_client

Rust client for The Movie Database (TMDB) API

15 releases (stable)

✓ Uses Rust 2018 edition

new 1.5.2 Nov 8, 2019
1.5.1 Nov 6, 2019
1.4.2 Oct 29, 2019
1.4.0 Jul 31, 2019
0.1.1 Jun 25, 2019

#25 in #client

Download history 28/week @ 2019-07-26 45/week @ 2019-08-02 36/week @ 2019-08-09 11/week @ 2019-08-16 40/week @ 2019-08-23 32/week @ 2019-08-30 31/week @ 2019-09-06 25/week @ 2019-09-13 111/week @ 2019-09-20 21/week @ 2019-09-27 11/week @ 2019-10-04 6/week @ 2019-10-11 59/week @ 2019-10-18 114/week @ 2019-10-25 58/week @ 2019-11-01

183 downloads per month

MIT license

385KB
7.5K SLoC

Rust API client for The Movie Database (TMDB)

Overview

This API client was generated by the OpenAPI Generator project, with a custom tmdb_oas.json OAS file.

  • API version: 3
  • Package version: 1.5.2
  • Build package: org.openapitools.codegen.languages.RustClientCodegen

Features

  • Almost all API functions are supported.
  • Library uses by default a basic rate limiter (at most one query each 260ms), to comply TMDB rate limit.
  • From 1.5.0 version, library provides helper functions to download and parse TMDB ids from daily exports.

Known issues

  • All API functions have not been tested. Since the OAS file used for generation is not official, there can be missing fields.
  • Generated code is not fluent. All API parameters are required in call functions.
  • Rate limiter could be smarter, and use response headers.

Installation

Add the following to Cargo.toml under [dependencies]:

tmdb_client = "1.5.2"

Usage example

use tmdb_client::apis::Error;
use tmdb_client::apis::client::APIClient;
use tmdb_client::models::MoviePaginated;

fn search_movie() -> Result<MoviePaginated, Error> {
    let client = APIClient::new_with_api_key("###TMDB_API_KEY###");
    // Parameters: title, year, primary_release_year, language, page, include_adult, region
    client.search_api().get_search_movie_paginated("Movie title", None, None, None, None, None, None)
}

Documentation for API Endpoints

All URIs are relative to https://api.themoviedb.org/3

Class Method HTTP request Description
AccountApi get_account_favorite_movies_paginated get /account/{account_id}/favorite/movies Get Favorite Movies
AccountApi get_account_favorite_tv_paginated get /account/{account_id}/favorite/tv Get Favorite TV Shows
AccountApi get_account_rated_movies_paginated get /account/{account_id}/rated/movies Get Rated Movies
AccountApi get_account_rated_tv_episodes_paginated get /account/{account_id}/rated/tv/episodes Get Rated TV Episodes
AccountApi get_account_rated_tv_paginated get /account/{account_id}/rated/tv Get Rated TV Shows
AccountApi get_account_watchlist_movies_paginated get /account/{account_id}/watchlist/movies Get Movie Watchlist
AccountApi get_account_watchlist_tv_paginated get /account/{account_id}/watchlist/tv Get TV Show Watchlist
AccountApi get_current_account_details get /account Get Details
AccountApi get_current_account_lists_paginated get /account/{account_id}/lists Get Created Lists
AccountApi post_account_favorite post /account/{account_id}/favorite Mark as Favorite
AccountApi post_account_watchlist post /account/{account_id}/watchlist Add to Watchlist
AuthenticationApi delete_authentication_session delete /authentication/session Delete Session
AuthenticationApi get_new_authentication_guest_session get /authentication/guest_session/new Create Guest Session
AuthenticationApi get_new_authentication_session get /authentication/session/new Create Session
AuthenticationApi get_new_authentication_token get /authentication/token/new Create Request Token
AuthenticationApi get_validate_authentication_token_with_login get /authentication/token/validate_with_login Validate Request Token
AuthenticationApi post_authentication_session_convert4 post /authentication/session/convert/4 Create Session (from v4 access token)
CertificationsApi get_movie_certifications_list get /certification/movie/list Get Movie Certifications
CertificationsApi get_tv_certifications_list get /certification/tv/list Get TV Certifications
ChangesApi get_movie_changes_paginated get /movie/changes Get Movie Change List
ChangesApi get_person_changes_paginated get /person/changes Get Person Change List
ChangesApi get_tv_changes_paginated get /tv/changes Get TV Change List
CollectionsApi get_collection_details get /collection/{collection_id} Get Details
CollectionsApi get_collection_images_list get /collection/{collection_id}/images Get Images
CollectionsApi get_collection_translations_list get /collection/{collection_id}/translations Get Translations
CompaniesApi get_company_details get /company/{company_id} Get Details
CompaniesApi get_company_images get /company/{company_id}/images Get Images
CompaniesApi get_company_movies_paginated get /company/{company_id}/movies Get Movies
ConfigurationApi get_configuration get /configuration Get API Configuration
ConfigurationApi get_countries_list get /configuration/countries Get Countries
ConfigurationApi get_jobs_list get /configuration/jobs Get Jobs
ConfigurationApi get_languages_list get /configuration/languages Get Languages
ConfigurationApi get_primary_translations_list get /configuration/primary_translations Get primary translations
ConfigurationApi get_timezones_list get /configuration/timezones Get List
CreditsApi get_credit_details get /credit/{credit_id} Get Details
DiscoverApi get_discover_movie_paginated get /discover/movie Movie Discover
DiscoverApi get_discover_tv_paginated get /discover/tv TV Discover
FindApi get_find_external_id get /find/{external_id} Find by ID
GenresApi get_all_movie_genres_list get /genre/movie/list Get Movie List
GenresApi get_all_tv_genres_list get /genre/tv/list Get TV List
GenresApi get_movies_by_genre_paginated get /genre/{genre_id}/movies Get Movies
GuestSessionsApi get_guest_session_rated_movies_paginated get /guest_session/{guest_session_id}/rated/movies Get Rated Movies
GuestSessionsApi get_guest_session_rated_tv_episodes_paginated get /guest_session/{guest_session_id}/rated/tv/episodes Get Rated TV Episodes
GuestSessionsApi get_guest_session_rated_tv_paginated get /guest_session/{guest_session_id}/rated/tv Get Rated TV Shows
KeywordsApi get_keyword_details get /keyword/{keyword_id} Get Details
KeywordsApi get_movies_by_keyword_paginated get /keyword/{keyword_id}/movies Get Movies
ListsApi delete_list delete /list/{list_id} Delete List
ListsApi get_list_details get /list/{list_id} Get Details
ListsApi get_list_item_status get /list/{list_id}/item_status Check Item Status
ListsApi post_list post /list Create List
ListsApi post_list_add_item post /list/{list_id}/add_item Add Movie
ListsApi post_list_clear post /list/{list_id}/clear Clear List
ListsApi post_list_remove_item post /list/{list_id}/remove_item Remove Movie
MoviesApi delete_movie_rating delete /movie/{movie_id}/rating Delete Rating
MoviesApi get_movie_account_states get /movie/{movie_id}/account_states Get Account States
MoviesApi get_movie_alternative_titles_list get /movie/{movie_id}/alternative_titles Get Alternative Titles
MoviesApi get_movie_changes_list get /movie/{movie_id}/changes Get Changes
MoviesApi get_movie_credits get /movie/{movie_id}/credits Get Credits
MoviesApi get_movie_details get /movie/{movie_id} Get Details
MoviesApi get_movie_external_ids get /movie/{movie_id}/external_ids Get External IDs
MoviesApi get_movie_images get /movie/{movie_id}/images Get Images
MoviesApi get_movie_keywords_list get /movie/{movie_id}/keywords Get Keywords
MoviesApi get_movie_latest_details get /movie/latest Get Latest
MoviesApi get_movie_lists_paginated get /movie/{movie_id}/lists Get Lists
MoviesApi get_movie_now_playing_paginated get /movie/now_playing Get Now Playing
MoviesApi get_movie_popular_paginated get /movie/popular Get Popular
MoviesApi get_movie_recommendations_paginated get /movie/{movie_id}/recommendations Get Recommendations
MoviesApi get_movie_release_dates get /movie/{movie_id}/release_dates Get Release Dates
MoviesApi get_movie_reviews_paginated get /movie/{movie_id}/reviews Get Reviews
MoviesApi get_movie_similar_paginated get /movie/{movie_id}/similar Get Similar Movies
MoviesApi get_movie_top_rated_paginated get /movie/top_rated Get Top Rated
MoviesApi get_movie_translations_list get /movie/{movie_id}/translations Get Translations
MoviesApi get_movie_upcoming_paginated get /movie/upcoming Get Upcoming
MoviesApi get_movie_videos_list get /movie/{movie_id}/videos Get Videos
MoviesApi post_movie_rating post /movie/{movie_id}/rating Rate Movie
NetworksApi get_network_alternative_names_list get /network/{network_id}/alternative_names Get Alternative Names
NetworksApi get_network_details get /network/{network_id} Get Details
NetworksApi get_network_images get /network/{network_id}/images Get Images
PeopleApi get_external_ids get /person/{person_id}/external_ids Get External IDs
PeopleApi get_person_changes get /person/{person_id}/changes Get Changes
PeopleApi get_person_combined_credits get /person/{person_id}/combined_credits Get Combined Credits
PeopleApi get_person_details get /person/{person_id} Get Details
PeopleApi get_person_images_list get /person/{person_id}/images Get Images
PeopleApi get_person_latest_details get /person/latest Get Latest
PeopleApi get_person_movie_credits get /person/{person_id}/movie_credits Get Movie Credits
PeopleApi get_person_popular_paginated get /person/popular Get Popular
PeopleApi get_person_tagged_images_paginated get /person/{person_id}/tagged_images Get Tagged Images
PeopleApi get_person_translations_list get /person/{person_id}/translations Get Translations
PeopleApi get_person_tv_credits get /person/{person_id}/tv_credits Get TV Credits
ReviewsApi get_review_details get /review/{review_id} Get Details
SearchApi get_search_collection_paginated get /search/collection Search Collections
SearchApi get_search_company_paginated get /search/company Search Companies
SearchApi get_search_keyword_paginated get /search/keyword Search Keywords
SearchApi get_search_movie_paginated get /search/movie Search Movies
SearchApi get_search_multi_paginated get /search/multi Multi Search
SearchApi get_search_person_paginated get /search/person Search People
SearchApi get_search_tv_paginated get /search/tv Search TV Shows
TVApi delete_tv_rating delete /tv/{tv_id}/rating Delete Rating
TVApi get_tv_account_states get /tv/{tv_id}/account_states Get Account States
TVApi get_tv_airing_today_paginated get /tv/airing_today Get TV Airing Today
TVApi get_tv_alternative_titles_list get /tv/{tv_id}/alternative_titles Get Alternative Titles
TVApi get_tv_changes get /tv/{tv_id}/changes Get Changes
TVApi get_tv_content_ratings_list get /tv/{tv_id}/content_ratings Get Content Ratings
TVApi get_tv_credits get /tv/{tv_id}/credits Get Credits
TVApi get_tv_details get /tv/{tv_id} Get Details
TVApi get_tv_episode_groups get /tv/{tv_id}/episode_groups Get Episode Groups
TVApi get_tv_external_ids get /tv/{tv_id}/external_ids Get External IDs
TVApi get_tv_images get /tv/{tv_id}/images Get Images
TVApi get_tv_keywords_list get /tv/{tv_id}/keywords Get Keywords
TVApi get_tv_latest_details get /tv/latest Get Latest
TVApi get_tv_on_the_air_paginated get /tv/on_the_air Get TV On The Air
TVApi get_tv_popular_paginated get /tv/popular Get Popular
TVApi get_tv_recommendations_paginated get /tv/{tv_id}/recommendations Get Recommendations
TVApi get_tv_screened_theatrically get /tv/{tv_id}/screened_theatrically Get Screened Theatrically
TVApi get_tv_similar_paginated get /tv/{tv_id}/similar Get Similar TV Shows
TVApi get_tv_top_rated_paginated get /tv/top_rated Get Top Rated
TVApi get_tv_translations_list get /tv/{tv_id}/translations Get Translations
TVApi get_tv_videos_list get /tv/{tv_id}/videos Get Videos
TVApi post_tv_rating post /tv/{tv_id}/rating Rate TV Show
TVEpisodeGroupsApi get_episode_group_details get /tv/episode_group/{episode_group_id} Get Details
TVEpisodesApi delete_tv_season_episode_rating delete /tv/{tv_id}/season/{season_number}/episode/{episode_number}/rating Delete Rating
TVEpisodesApi get_tv_episode_changes get /tv/episode/{episode_id}/changes Get Changes
TVEpisodesApi get_tv_season_episode_account_states get /tv/{tv_id}/season/{season_number}/episode/{episode_number}/account_states Get Account States
TVEpisodesApi get_tv_season_episode_credits get /tv/{tv_id}/season/{season_number}/episode/{episode_number}/credits Get Credits
TVEpisodesApi get_tv_season_episode_details get /tv/{tv_id}/season/{season_number}/episode/{episode_number} Get Details
TVEpisodesApi get_tv_season_episode_external_ids get /tv/{tv_id}/season/{season_number}/episode/{episode_number}/external_ids Get TV Episode External IDs
TVEpisodesApi get_tv_season_episode_images get /tv/{tv_id}/season/{season_number}/episode/{episode_number}/images Get Images
TVEpisodesApi get_tv_season_episode_translations_list get /tv/{tv_id}/season/{season_number}/episode/{episode_number}/translations Get Translations
TVEpisodesApi get_tv_season_episode_videos_list get /tv/{tv_id}/season/{season_number}/episode/{episode_number}/videos Get Videos
TVEpisodesApi post_tv_season_episode_rating post /tv/{tv_id}/season/{season_number}/episode/{episode_number}/rating Rate TV Episode
TVSeasonsApi get_tv_season_account_states get /tv/{tv_id}/season/{season_number}/account_states Get Account States
TVSeasonsApi get_tv_season_changes get /tv/season/{season_id}/changes Get Changes
TVSeasonsApi get_tv_season_credits get /tv/{tv_id}/season/{season_number}/credits Get Credits
TVSeasonsApi get_tv_season_details get /tv/{tv_id}/season/{season_number} Get Details
TVSeasonsApi get_tv_season_external_ids get /tv/{tv_id}/season/{season_number}/external_ids Get External IDs
TVSeasonsApi get_tv_season_images get /tv/{tv_id}/season/{season_number}/images Get Images
TVSeasonsApi get_tv_season_videos get /tv/{tv_id}/season/{season_number}/videos Get Videos
TrendingApi get_trending_paginated get /trending/{media_type}/{time_window} Get Trending

Documentation For Models

To get access to the crate's generated documentation, use:

cargo doc --open

Author

Dependencies

~16MB
~386K SLoC