Global

Members

(constant) getConfig

Source:

Returns configuration information from TMDb.

(constant) getTVGenres

Source:

Returns a TV Genre map from TMDb.

(constant) getMovieGenres

Source:

Returns a Movie Genre map from TMDb.

Methods

initTMDB(apiKey, options)

Source:

Initialization function that MUST be run before any other function can be accessed. Set a number of constants that can be accessed by calling the getTMDBConsts() function or by importing the constants themselves

Parameters:
Name Type Description
apiKey string

required API Key to access TMDB

options object

options object { dateFormatString //dateFormatString as used by fns-date https://date-fns.org/v2.7.0/docs/format }

updateAPIOptions(options)

Source:

Updates the API_OPTIONS objects

Parameters:
Name Type Description
options object

options object { dateFormatString //dateFormatString as used by fns-date https://date-fns.org/v2.7.0/docs/format }

getTMDBConsts()

Source:

This function returns the needed constants that the TDMB calls need to get their data

Parameters:
Type Description
object

TMDB Constants

convertGenreToObj(genres)

Source:

Take array of genre objects and convert to object: { [id]: genre name, }

Parameters:
Name Type Description
genres object

Type Definitions

ErrorObj

Source:
Properties:
Name Type Description
error Object

the error object thrown from original error. Assuming from axios

status string

err.response.request.status

status string

err.response.request.statusText

status string

err.response.request.responseURL

Type:
  • Object

searchForPersonId_typedef

Source:
Properties:
Name Type Description
data Object

the data object

Properties
Name Type Description
page number

current page returned

totalResults number

total number of persons found

totalPages number

total pages use for pagination

results Array

results of the search

Properties
Name Type Description
id number

the personId

name string
popularity number
apiCall string

the API call used to hit endpoint

Type:
  • Object

getPersonDetails_typedef

Source:
Properties:
Name Type Description
data Object

results of the search

Properties
Name Type Description
id number

the personId

name string
birthday date
deathDay date
knownForDepartment string
biography string
placeOfBirth string
profileImage string
imdbId string
apiCall string

the API call used to hit endpoint

Type:
  • Object

getPersonImages_typedef

Source:
Properties:
Name Type Description
data array

results of the search

Properties
Name Type Description
width number
height string
aspectRatio date
imageURL string
apiCall string

the API call used to hit endpoint

Type:
  • Object

imagesReturn_typedef

Source:
Properties:
Name Type Description
data Array

Array of image URLs

apiCall string

the API call used to hit endpoint

Type:
  • Object

movieWatchProviders_typedef

Source:
Properties:
Name Type Description
data Object

the data object

Properties
Name Type Description
id number

the movie id

results Array

results of the call

Properties
Name Type Description
id number

the movieId

[countryCode string

Based on the array of country codes sent (defaults to just US)

[countryCode].justWatchLink string

Link to tmdb API's just watch page

[countryCode].stream array.<object>

array of objects, each with streaming information for a provider

Properties
Name Type Description
displayPriority number
logoURL string

URL to the logo image of the provider (Square, usually 100x100)

providerId number
provider string

Name of provider (Netflix, Amazon Prime, etc)

[countryCode].buy array.<object>

array of objects, each with purchase information for a provider

Properties
Name Type Description
displayPriority number
logoURL string

URL to the logo image of the provider (Square, usually 100x100)

providerId number
provider string

Name of provider (Netflix, Amazon Prime, etc)

[countryCode].rent array.<object>

array of objects, each with renting information for a provider

Properties
Name Type Description
displayPriority number
logoURL string

URL to the logo image of the provider (Square, usually 100x100)

providerId strnumbering
provider string

Name of provider (Netflix, Amazon Prime, etc)

apiCall string

the API call used to hit endpoint

Type:
  • Object

movieSearchByTitle_typedef

Source:
Properties:
Name Type Description
data Object

the data object

Properties
Name Type Description
page number

current page returned

totalResults number

total number of movies search found

totalPages number

total pages use for pagination

results Array

results of the search

Properties
Name Type Description
id number

the movieId

title string
overview string
releaseDate int

returns an object with options for date {date, epoch, formatted}

posterURL string
backdropURL string
genres array.<string>

array of genre names

apiCall string

the API call used to hit endpoint

Type:
  • Object

movieDetails_typedef

Source:
Properties:
Name Type Description
data Object

the data object

Properties
Name Type Description
id number

the movieId

title string
tagline string
overview string
status string
runtime number

runtime in minutes

budget number
revenue number
releaseDate object

returns an object with options for date {date, epoch, formatted}

posterURL string
backdropURL string
imdbId string
imdbURL string
genres array.<string>

array of genre names

videos array.<object>

movieVideos_typedef -> array of video objects if withVideos=true- fields are { videoURL, videoThumbnailURL, id, language, country, key, name, site, size, type }

apiCall string

the API call used to hit endpoint

Type:
  • Object

movieVideos_typedef

Source:
Properties:
Name Type Description
data Array

the data array is an array of objects

Properties
Name Type Description
id string

the videoId

language string
country string
key string
name string
site number
size number
type number
videoURL object
videoThumbnailURL string
apiCall string

the API call used to hit endpoint

Type:
  • Object

moviesRecommendations_typedef

Source:
Properties:
Name Type Description
data Object

the data object

Properties
Name Type Description
page number

current page returned

totalResults number

total number of movies search found

totalPages number

total pages use for pagination

results Array

results of the search

Properties
Name Type Description
id number

the movieId

title string
overview string
releaseDate int

returns an object with options for date {date, epoch, formatted}

posterURL string
backdropURL string
genres array.<string>

array of genre names

apiCall string

the API call used to hit endpoint

Type:
  • Object

moviesPopular_typedef

Source:
Properties:
Name Type Description
data Object

the data object

Properties
Name Type Description
page number

current page returned

totalResults number

total number of movies search found

totalPages number

total pages use for pagination

results Array

results of the search

Properties
Name Type Description
id number

the movieId

title string
overview string
releaseDate int

returns an object with options for date {date, epoch, formatted}

posterURL string
backdropURL string
genres array.<string>

array of genre names

apiCall string

the API call used to hit endpoint

Type:
  • Object

movieCredits_typedef

Source:
Properties:
Name Type Description
data Object

the data object

Properties
Name Type Description
cast Array

the cast array

Properties
Name Type Description
personId number
name string
characterName string
creditId string
gender number

1 is Female, 2 is Male

profileURL string
crew string

the crew array

Properties
Name Type Description
personId number
name string
creditId string
job string
department string
gender number

1 is Female, 2 is Male

profileURL string
apiCall string

the API call used to hit endpoint

Type:
  • Object

moviePersonCredits_typedef

Source:
Properties:
Name Type Description
data Object

the data object

Properties
Name Type Description
cast Array

the cast array

Properties
Name Type Description
movieId number
title string
overview string
releaseDate date
creditId string
characterName string
genres Array
posterURL string
backdropURL string
orginalLanguage string
crew string

the crew array

cast.movieId number
cast.title string
cast.overview string
cast.releaseDate string
cast.creditId string
cast.job string
cast.department string
cast.genres Array
cast.posterURL string
cast.backdropURL string
cast.orginalLanguage string
apiCall string

the API call used to hit endpoint

Type:
  • Object

movieDiscover_typedef

Source:
Properties:
Name Type Description
data Object

the data object

Properties
Name Type Description
page number

current page returned

totalResults number

total number of movies search found

totalPages number

total pages use for pagination

results Array

results of the search

Properties
Name Type Description
id number

the movieId

title string
popularity number
originalLanguage string
overview string
releaseDate date
posterURL string
backdropURL string
genres array.<string>

array of genre names

apiCall string

the API call used to hit endpoint

Type:
  • Object

movieDiscoverCriteria_typedef

Source:
Properties:
Name Type Description
genres Array

genre Ids

releaseYear int

Primary Release Year

releaseDateGTE date | string

movies with release date >= date YYYY-MM-DD format either JS Date or string "YYYY-MM-DD"

releaseDateLTE date | string

movies with release date <= date YYYY-MM-DD format either JS Date or string "YYYY-MM-DD"

cast Array

person Ids. Only include movies that have one of the Id's added as an actor

crew Array

person Ids. Only include movies that have one of the Id's added as a crew member

watchProviders Array

Watch providers ids to search limit search by. Couple with region if desired

watchRegions Array

An ISO 3166-1 code. Combine this filter with with_watch_providers in order to filter your results by a specific watch provider in a specific region. > As of 2/2021 a region must be used or no filtering will occur. US is sent over as a default.

sortBy string

Options

  • popularity.asc
  • popularity.desc Default
  • release_date.asc
  • release_date.desc
  • revenue.asc
  • revenue.desc
  • primary_release_date.asc
  • primary_release_date.desc
  • original_title.asc
  • original_title.desc
  • vote_average.asc
  • vote_average.desc
  • vote_count.asc
  • vote_count.desc
Type:
  • Object

tvGetImages_typedef

Source:
Properties:
Name Type Description
data Array

array of image URLs (https://...)

apiCall string

the API call used to hit endpoint

Type:
  • Object

tvSearchByTitle_typedef

Source:
Properties:
Name Type Description
data Object

the data object

Properties
Name Type Description
page number

current page returned

totalResults number

total number of movies search found

totalPages number

total pages use for pagination

results Array

results of the search

Properties
Name Type Description
id number

the tv showId

name string

name of the tv show

overview string
firstAirDate date
backdropURL string
genres array.<string>

array of genre names

apiCall string

the API call used to hit endpoint

Type:
  • Object

tvShowDetails_typedef

Source:
Properties:
Name Type Description
data Object

the data object

Properties
Name Type Description
id number

the tv showId

name string

name of the tv show

overview string
status string
avgEpisodeRunTime number

average runtime in minutes

firstAirDate date
lastAirDate date
posterURL string
backdropURL string
homePage string
numberOfEpisodes number
numberOfSeasons number
genres array.<string>

array of genre names

apiCall string

the API call used to hit endpoint

Type:
  • Object

tvCredits_typedef

Source:
Properties:
Name Type Description
data Object

the data object

Properties
Name Type Description
cast Array

the cast array

Properties
Name Type Description
personId number
name string
characterName string
creditId string
gender number

1 is Female, 2 is Male

profileURL string
order string
crew string

the crew array

Properties
Name Type Description
personId number
name string
creditId string
job string
department string
gender number

1 is Female, 2 is Male

profileURL string
apiCall string

the API call used to hit endpoint

Type:
  • Object