Supporto The Movie Database

Is there a way to get a actor and all the films IMDB or TMDB numbers he/she is in?

for instance

$client = new MovieScrapper('TMDB_API_KEY');
// Get Person information by TheMovieDB's Person ID
$person = $client->person('1327');
    public function person($id)
    {
        $this->validateKeys(['tmdb' => $id]);
        $url = $this->apiUrl . 'person/' . $id . '?append_to_response=external_ids,images&api_key=' . $this->apiKey;
        return $this->formatPerson($this->toArray($this->request($url)));
    }
    /**
     * @param $person
     * @return Person
     */
    private function formatPerson($person)
    {
        return new Person([
            'imdb'         => !empty($person['imdb_id']) ? $person['imdb_id'] : null,
            'tmdb'         => !empty($person['id']) ? $person['id'] : null,
            'name'         => !empty($person['name']) ? $person['name'] : null,
            'aka'          => !empty($person['also_known_as']) ? $person['also_known_as'] : null,
            'gender'       => !empty($person['gender']) ? ($person['gender'] == 1 ? 'female' : ($person['gender'] == 2 ? 'male' : null)) : null,
            'birthday'     => !empty($person['birthday']) ? $person['birthday'] : null,
            'deathday'     => !empty($person['deathday']) ? $person['deathday'] : null,
            'placeOfBirth' => !empty($person['place_of_birth']) ? $person['place_of_birth'] : null,
            'biography'    => !empty($person['biography']) ? $person['biography'] : null,
            'photo'        => !empty($person['profile_path']) ? $this->imageProfilePath . $person['profile_path'] : null,
            'photos'       => !empty($person['images']['profiles']) ? $this->formatImages($person['images']['profiles'],
                $this->imageProfilePath, $person['profile_path']) : null,
        ]);
    }

Is there something I can add to call that returns films IMDB or TMDB numbers he/she is in?

3 risposte (nella pagina 1 di 1)

Jump to last post

To get all of the films a person has been in, call the /movie_credits method.

@travisbell said:

To get all of the films a person has been in, call the /movie_credits method.

Great thank you!

I see it returns like this which is great!

    {
      "character": "Fletcher",
      "credit_id": "52fe437f9251416c75012b97",
      "release_date": "2009-01-09",
      "vote_count": 1224,
      "video": false,
      "adult": false,
      "vote_average": 6,
      "title": "Bride Wars",
      "genre_ids": [
        35,
        10749
      ],
      "original_language": "en",
      "original_title": "Bride Wars",
      "popularity": 9.268958,
      "id": 10521,
      "backdrop_path": "/f7pTesNnPjOVAq7QqhgnSHaK9Cc.jpg",
      "overview": "Two best friends become rivals when their respective weddings are accidentally booked for the same day.",
      "poster_path": "/y5O46J9i98MkcExaPIeZaRImF4C.jpg"
    },

The ID "id": 10521, I assume is the TMDB ID. Does it return IMDB ID as well anyway?

You can only get the IMDB ID from the objects /external_ids method. It's not included in all of the list methods (search, discover, credits, etc...)

Non riesci a trovare un film o una serie Tv? Accedi per crearlo.

Globale

s focalizza la barra di ricerca
p apri menu profilo
esc chiudi una finestra aperta
? apri finestra scorciatoia tastiera

Su tutte le pagine di media

b torna indietro (o al precedente quando applicabile)
e vai alla pagina di modifica

Nelle pagine delle stagioni TV

(freccia destra) vai alla stagione successiva
(freccia sinistra) vai alla stagione precedente

Nelle pagine degli episodi TV

(freccia destra) vai all'episodio successivo
(freccia sinistra) vai all'episodio precedente

Su tutte le pagine di immagini

a apri finestra aggiungi immagine

Su tutte le pagine di modifica

t apri selettore traduzione
ctrl+ s invia modulo

Sulle pagine di discussione

n crea nuova discussione
w segna come visto/non visto
p cambia publico/privato
c cambia chiuso/aperto
a apri attivita
r rispondi alla discussione
l vai all'ultima risposta
ctrl+ enter invia il tuo messaggio
(freccia destra) pagina successiva
(freccia sinistra) pagina precedente

Impostazioni

Vuoi valutare o aggiungere quest'elemento a una lista?

Accedi