-
Notifications
You must be signed in to change notification settings - Fork 38
Movies
Get the basic movie information for a specific movie id.
MovieMDB.movie(apikey, movieID: 7984, language: "en"){
apiReturn in
let movie = apiReturn.MBDBReturn as! MovieDetailedMDB
print(movie.title)
print(movie.revenue)
print(movie.genres[0].name)
print(movie.production_companies[0].name)
}
Get the alternative titles for a specific movie id.
MovieMDB.alternativeTitles(apikey, movieID: 12, country: nil){
apiReturn in
let altTitles = apiReturn.MBDBReturn as! Alternative_TitlesMDB
print(apiReturn.json)
print(altTitles.titles[0])
print(altTitles.id)
}
Get the cast and crew information for a specific movie id.
MovieMDB.credits(apikey, movieID: 871){
apiReturn in
let credits = apiReturn.MBDBReturn as! CastCrewMDB
for i in credits.cast {
print(i.cast_id)
}
for i1 in credits.crew {
print(i1.job)
}
}
Get the images (posters and backdrops) for a specific movie id.
MovieMDB.images(apikey, movieID: 871, language: "en"){
imgs in
let images = imgs.MBDBReturn as! ImagesMDB
print(images.posters[0].file_path)
//Backdrop & stills might return `nil`
// print(images.stills[0].file_path)
//print(images.backdrops[0].file_path)
}
Get the plot keywords for a specific movie id.
MovieMDB.keywords(apikey, movieID: 1721){
apiReturn in
let keywords = apiReturn.MBDBReturn as! [KeywordsMDB]
for keyword in keywords{
print(keyword.id)
print(keyword.name)
}
}
Get the release dates, certifications and related information by country for a specific movie id.
MovieMDB.release_dates(apikey, movieID: 293660){
apiReturn in
let releaseDates = apiReturn.MBDBReturn as! [MovieReleaseDatesMDB]
for releaseDate in releaseDates{
print(releaseDate.iso_3166_1)
print(releaseDate.release_dates[0].certification)
print(releaseDate.release_dates[0].iso_639_1!) //possible nil value
print(releaseDate.release_dates[0].note!) //possible nil value
print(releaseDate.release_dates[0].release_date)
print(releaseDate.release_dates[0].type)
}
}
Get the videos (trailers, teasers, clips, etc...) for a specific movie id.
MovieMDB.videos(apikey, movieID: 607, language: "en"){
apiReturn in
let videos = apiReturn.MBDBReturn as! [VideosMDB]
for i in videos {
print(i.site)
print(i.key)
print(i.name)
}
}
Get the lists that the movie belongs to.
MovieMDB.list(apikey, movieID: 1396, page: 1, language: "en"){
apiReturn in
let lists = apiReturn.MBDBReturn as! [MovieListMDB]
for list in lists{
print(list.name!)
print(list.description)
print(list.item_count)
}
}
Get the similar movies for a specific movie id.
MovieMDB.similar(apikey, movieID: 334, page: 1, language: "en"){
relatedMovies in
let movie = relatedMovies.MBDBReturn as! [MovieMDB]
print(movie[0].title)
print(movie[0].original_title)
print(movie[0].release_date)
print(movie[0].overview)
}
Get the translations for a specific movie id.
MovieMDB.translations(apikey, movieID: 1396){
apiReturn in
let translations = apiReturn.MBDBReturn as! [TranslationsMDB]
for translation in translations{
print(translation.iso_639_1)
print(translation.english_name)
print(translation.name)
}
}
Get the latest movie id.
MovieMDB.latest(apikey){
latestMovies in
let movie = latestMovies.MBDBReturn as! MovieDetailedMDB
print(movie.title)
print(movie.original_title)
print(movie.release_date)
print(movie.overview)
print(movie.budget)
}
Get the list of movies playing that have been, or are being released this week. This list refreshes every day.
MovieMDB.nowplaying(apikey, language: "en", page: 1){
nowPlaying in
let movie = nowPlaying.MBDBReturn as! [MovieMDB]
print(movie[0].title)
print(movie[0].original_title)
print(movie[0].release_date)
print(movie[0].overview)
}
Get the list of popular movies on The Movie Database. This list refreshes every day.
MovieMDB.popular(apikey, language: "en", page: 1){
popularMovies in
let movie = popularMovies.MBDBReturn as! [MovieMDB]
print(movie[0].title)
print(movie[0].original_title)
print(movie[0].release_date)
print(movie[0].overview)
}
Get the list of top rated movies. By default, this list will only include movies that have 50 or more votes. This list refreshes every day.
MovieMDB.toprated(apikey, language: "en"){
topRatedMovies in
let movie = topRatedMovies.MBDBReturn as! [MovieMDB]
print(movie[0].title)
print(movie[0].original_title)
print(movie[0].release_date)
print(movie[0].overview)
}
Get the list of upcoming movies by release date. This list refreshes every day.
MovieMDB.upcoming(apikey, language: "en"){
upcomingMovies in
let movie = upcomingMovies.MBDBReturn as! [MovieMDB]
print(movie[0].title)
print(movie[0].original_title)
print(movie[0].release_date)
print(movie[0].overview)
}