themoviedb
Module themoviedb
API
![](https://bcentral-packageicons.azureedge.net/images/ballerinax_themoviedb_1.2.0.png)
ballerinax/themoviedb Ballerina library
Overview
This is a generated connector for The Movie Database (TMDB) API v3 OpenAPI specification.
The Movie Database (TMDB) API provide data about movies and tv shows around the world.
Prerequisites
Before using this connector in your Ballerina application, complete the following:
- Create TMDB Account
- Obtaining tokens
- Log into TMDB Account
- Click the
Settings
- Click the
API
tab in the left sidebar - Click
Create
orclick here
on the API page
Quickstart
Step 1: Import connector
Import the ballerinax/themoviedb module into the Ballerina project.
import ballerinax/themoviedb;
Step 2: Create a new connector instance
themoviedb:ApiKeysConfig config = { apiKey : "<your appid>" } themoviedb:Client myclient = check new themoviedb:Client(config);
Step 3: Invoke connector operation
- You can get list of upcoming movies as follows with
getUpcomingMovies
method. Successful creation returns the createdGetUpcomingMoviesResponse
and the error cases returns anerror
object.themoviedb:GetUpcomingMoviesResponse result = check myclient->getUpcomingMovies();
- Use
bal run
command to compile and run the Ballerina program.
Clients![](/images/permalink.svg)
themoviedb: Client![](/images/permalink.svg)
This is a generated connector for The Movie Database (TMDB) API v3 OpenAPI specification. The Movie Database (TMDB) API provide data about movies and tv shows around the world.
Constructor![](/images/permalink.svg)
Gets invoked to initialize the connector
.
The connector initialization requires setting the API credentials.
Request a TMDB Account and obtain tokens following this guide.
init (ApiKeysConfig apiKeyConfig, ClientConfiguration clientConfig, string serviceUrl)
- apiKeyConfig ApiKeysConfig - API keys for authorization
- clientConfig ClientConfiguration {} - The configurations to be used when initializing the
connector
- serviceUrl string "https://api.themoviedb.org/3" - URL of the target service
getPopularMovies![](/images/permalink.svg)
function getPopularMovies() returns InlineResponse200|error
Get Popular Movies
Return Type
- InlineResponse200|error - Get popular movies response
getUpcomingMovies![](/images/permalink.svg)
function getUpcomingMovies() returns InlineResponse2001|error
Get Upcoming Movies
Return Type
- InlineResponse2001|error - Get upcoming movies response
getMovieByMovieId![](/images/permalink.svg)
function getMovieByMovieId(int movieId) returns InlineResponse2002|error
Get Movie Details
Parameters
- movieId int - Movie ID
Return Type
- InlineResponse2002|error - Get movie by movie ID response
getTopRatedTvShow![](/images/permalink.svg)
function getTopRatedTvShow() returns InlineResponse2003|error
Get Top Rated
Return Type
- InlineResponse2003|error - Get top rated TV show response
getTvShowEpisode![](/images/permalink.svg)
function getTvShowEpisode(int tvId, int seasonNumber, int episodeNumber) returns InlineResponse2004|error
Get Details
Parameters
- tvId int - TV show ID
- seasonNumber int - TV show season number
- episodeNumber int - TV show episode number
Return Type
- InlineResponse2004|error - Get TV show by details response
searchMovie![](/images/permalink.svg)
function searchMovie(string query, int? year) returns InlineResponse200|error
Search Movies
Return Type
- InlineResponse200|error - Search movie response
searchTvShow![](/images/permalink.svg)
function searchTvShow(string query, int? firstAirDateYear) returns InlineResponse2003|error
Search TV Shows
Return Type
- InlineResponse2003|error - Search TV show response
Records![](/images/permalink.svg)
themoviedb: ApiKeysConfig![](/images/permalink.svg)
Provides API key configurations needed when communicating with a remote HTTP endpoint.
Fields
- apiKey string - All requests on the TMDB API needs to include an API key. The API key can be provided as part of the query string or as a request header. The name of the API key needs to be
api_key
themoviedb: Crew![](/images/permalink.svg)
Crew details of TV show
Fields
- id int - Crew ID
- credit_id string? - Credit ID of crew
- name string - Name of the crew
- department string? - Crew department
- job string? - Job of the crew
- profile_path string? - Profile image path
themoviedb: Genre![](/images/permalink.svg)
Genere of movie
Fields
- id int - Genre ID
- name string - Genre name
themoviedb: GuestStar![](/images/permalink.svg)
Guest star details of TV show
Fields
- id int - Guest star ID
- name string - Name of the guest star
- credit_id string? - Credit ID of guest star
- character string? - Character of guest star
- 'order string? - Order of guest star
- profile_path string? - Profile image path
themoviedb: InlineResponse200![](/images/permalink.svg)
Fields
- page int - Specify which page to query
- results MovieListObject[] - Movie List Object
- total_results int - Total number of results
- total_pages int - Total number of pages
themoviedb: InlineResponse2001![](/images/permalink.svg)
Fields
- page int - Specify which page to query
- results MovieListObject[] - Movie List Object
- dates ReleaseDateRange - Release date range
- total_pages int - Total number of pages
- total_results anydata - Total number of results
themoviedb: InlineResponse2002![](/images/permalink.svg)
Fields
- adult boolean? - Adult content or not
- backdrop_path string? - Backdrop image path
- budget int? - Budget of movie
- genres Genre[]? - Genres of movie
- id int - Movie ID
- original_language string? - Original language of movie
- original_title string? - Original title of movie
- popularity decimal? - Popularity of movie
- poster_path string? - Poster image path
- production_companies ProductionCompany[]? - Movie production companies
- production_countries ProductionCountry[]? - Countries where movie produced
- release_date string? - Release date of movie
- revenue int? - Revenue genereted by movie
- spoken_languages SpokenLanguage[]? - Languages spoken in movie
- status string? - Status of movie
- title string - Title of movie
- video boolean? - Contain videos or not
- vote_average decimal? - Vote average
- vote_count int? - Vote count
themoviedb: InlineResponse2003![](/images/permalink.svg)
Fields
- page int - Specify which page to query
- results TvListObject[] - TV List Object
- total_results int - Total number of results
- total_pages int - Total number of pages
themoviedb: InlineResponse2004![](/images/permalink.svg)
Fields
- air_date string? - Air date of TV show
- crew Crew[] - Crew details of TV show
- episode_number int - Episode number
- guest_stars GuestStar[]? - Guest stars in TV show
- name string - Crew details of TV show
- overview string - Overview of TV show
- id int - TV show ID
- season_number int - Season number
- still_path string? - Still path
- vote_average decimal? - Vote average
- vote_count int? - Vote count
themoviedb: InlineResponse401![](/images/permalink.svg)
Fields
- status_message string? -
- status_code int? -
themoviedb: MovieListObject![](/images/permalink.svg)
Movie list object
Fields
- poster_path string? - Poster image path
- adult boolean? - Adult content or not
- overview string - Overview of movie
- release_date string? - Release date
- genre_ids int[]? - Genre IDs of movie
- id int - Movie ID
- original_title string? - Original title
- original_language string? - Original language
- title string - Title of movie
- backdrop_path string? - Backdrop image path
- popularity decimal? - Popularity of movie
- vote_count int? - Vote count
- video boolean? - Video available or not
- vote_average decimal? - Vote average
themoviedb: ProductionCompany![](/images/permalink.svg)
Production company
Fields
- name string - Production company name
- id int - Production company ID
- origin_country string? - Country of production company
themoviedb: ProductionCountry![](/images/permalink.svg)
Production country
Fields
- iso_3166_1 string - Standard for representation of country names
- name string - Production country name
themoviedb: ReleaseDateRange![](/images/permalink.svg)
Release date range
Fields
- maximum string - Maximum date of release
- minimum string - Minimum date of release
themoviedb: SpokenLanguage![](/images/permalink.svg)
Spoken language
Fields
- iso_639_1 string - Standard for representation of languages
- name string - Spoken language name
themoviedb: TvListObject![](/images/permalink.svg)
TV list object
Fields
- poster_path string? - Poster image path
- popularity decimal? - Popularity of TV show
- id int - TV show ID
- backdrop_path string? - Backdrop image path
- vote_average decimal? - Vote average
- overview string - Overview of TV show
- first_air_date string? - First air date of TV show
- origin_country string[]? - Origin country
- genre_ids int[]? - Genre IDs of TV show
- original_language string? - Original language
- vote_count int? - Vote count
- name string - Name
- original_name string? - Original name of TV show
Import
import ballerinax/themoviedb;
Metadata
Released date: over 2 years ago
Version: 1.2.0
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: 2201.0.0
GraalVM compatible: Yes
Pull count
Total: 2017
Current verison: 1461
Weekly downloads
Keywords
Content & Files/Video & Audio
Cost/Free
Contributors