Skip to content

Collections

George Kye edited this page Feb 16, 2016 · 5 revisions
Required Parameters Optional Parameters
api_key language ISO 639-1 code.

Collection Information

Get the basic collection information for a specific collection id. You can get the ID needed for this method by making a /movie/{id} request and paying attention to the belongs_to_collection hash.

```swift //Get information about The Avengers Collection(86311) CollectionMDB.Collection(apikey, collectionId: 86311, language: "EN"){ apiReturn in if apiReturn.error == nil{ let collection = apiReturn.MBDBReturn as! CollectionMDB print(collection.name) print(collection.overview) print(collection.collectionItems[0].title) print(collection.collectionItems[0].overview) } } ```

Collection Images

Get all of the images for a particular collection by collection id.

//Get images from Starwars collection (10)
        CollectionMDB.CollectionImages(apikey, collectionId: 10, language: "EN"){
            apiReturn in
            if(apiReturn.error == nil){
                let images = apiReturn.MBDBReturn as! ImagesMDB
                print(images.backdrops[0].file_path)
                print(images.posters[0].file_path)
            }
        }
Clone this wiki locally