Person Details

Learn and practice how to fetch the primary details of a person using TMDB API.

In this lesson, we’ll focus on how to fetch two main things—details of a person in a TV show or a movie and all the credits for a person in either a TV show or a movie.

The details of a person

Like movies and TV shows, we can fetch the details for each person as well. We can use the person endpoint to get the basic information about any person. A person can be any cast or crew member of any movie or TV show. This endpoint takes in an integer path parameter person_id and returns the details of that person in a single JSON response.

Here is the base URL in focus:

https://api.themoviedb.org/3/person/{person_id}?api_key={ourTMDBapikey}

The input query parameters required by this endpoint are as follows:

Name

Type

Category

Description

language

string

optional

This is an ISO_3166_1 code used to get the translated data as per the specified language. This is applicable to only the fields that support it. The default value is en-US.

append_to_response

string

optional

This is used to append requests within the same namespace to the response. It follows the pattern ([\w]+).


The objects in the output JSON response are as follows:

Object

Type

Category

Description

adult

boolean

optional

This is the flag that shows whether or not the person is a part of adult content.

birthday

string or null

optional

This returns the date of birth of the person.

known_for_department

string

optional

This returns the department name for which the person is famous. For example, Matthew Perry is famous for acting.

deathday

null or string

optional

This returns the date of death of the person (only if applicable).

id

integer

optional

This is the ID associated with the person on TMDB (it's the same, we pass it as an input parameter).

name

string

optional

This is the original name of the person.

also_known_as

array[string]

optional

This returns all the names by which the person is commonly known.

gender

integer

optional

This returns an integer representing the gender of the person. The value 0 represents not specified, 1 represents female and 2  is for males.

biography

string

optional

This returns a few lines or a short paragraph of text that presents a biography of the person.

popularity

number

optional

This is the popularity score of the person on TMDB.

place_of_birth

string or null

optional

This returns the birthplace of the person.

profile_path

string or null

optional

This returns the path to the profile picture of the person.

imdb_id

string

optional

This returns the IMDB ID (an external ID) associated with the person on IMDB.

homepage

null or string

optional

This returns the URL to the homepage of the person if any.

The code widget below shows how the basic ...