Skip to content
George Kye edited this page Oct 26, 2016 · 10 revisions

Get the general person information for a specific id.

    PersonMDB.person_id(apikey, personID: 287){
      data, personData in
      if let person = personData{
        print(person.name)
        print(person.also_known_as)
        print(person.biography)
        print(person.birthday)
        print(person.homepage)
      }
    }

Get the movie credits for a specific person id.

    PersonMDB.movie_credits(apikey, personID: 1245, language: "en"){
      data, credits in
      if let d = credits{
        print(d.cast.count)
        print(d.crew.count)
        print(d.crew[0].title)
        print(d.crew[0].poster_path)
      }
    }

Get the TV credits for a specific person id.

    PersonMDB.tv_credits(apikey, personID: 1245, language: "en"){
      data, credits in
      if let credit = credits{
        print(credit.cast.count)
        print(credit.crew.count)
        print(credit.cast[0].episode_count)
        print(credit.cast[0].character)
        print(credit.cast[0].original_name)
      }
    }

Get the combined (movie and TV) credits for a specific person id.

    PersonMDB.combined_credits(apikey, personID: 1245, language: "en"){
      data, credits in
      if let creditsData = credits{
        print(creditsData.movieCredits.cast?.count)
        print(creditsData.movieCredits.crew?.count)
        print(creditsData.tvCredits.cast?.count)
        print(creditsData.tvCredits.crew?.count)
      }
    }

Get the external ids for a specific person id.

    PersonMDB.externalIDS(apikey, personID: 287){
      apiReturn, externalIds in
      if let exIds = externalIds{
        print(exIds.freebase_id)
        print(exIds.imdb_id)
        print(exIds.tvrage_id)
        print(exIds.id)
      }
    }

Get the images for a specific person id.

    PersonMDB.images(apikey, personID: 287){
      apiReturn, images in
      if let images = images{
        for image in images{
          print(image.file_path)
          print(image.width)
          print(image.iso_639_1)
        }
      }
    }

Get the images that have been tagged with a specific person id. Will return all of the image results with a media object mapped for each image.

         PersonMDB.tagged_images(apikey, personID: 1245, page: 2){
      data, imgs in
      if let images = imgs{
        print(images.movieImages.count)
        print(images.tvImages.count)
        print(images.movieImages[0].file_path)
        print(images.movieImages[0].media.overview)
      }
    }

Get the latest person id.

    PersonMDB.latest(apikey){
      data, personRtn in
      if let person = personRtn{
        print(person.name)
        print(person.also_known_as)
        print(person.biography)
        print(person.birthday)
        print(person.homepage)
      }
    }

Get the list of popular people on The Movie Database. This list refreshes every day.

    PersonMDB.popular(apikey, page: 1){
      data, ppl in
      if let people = ppl{
        print(people[0].name)
        print(people[0].known_for.tvShows?.count)
        print(people[0].known_for.movies?.count)
      }
    }
Clone this wiki locally