Swiftpack.co - adamayoung/TMDb as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by adamayoung.
adamayoung/TMDb 8.0.0
The Movie Database Swift Package
⭐️ 12
🕓 1 week ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/adamayoung/TMDb.git", from: "8.0.0")

TMDb - The Movie Database

CI

A Swift Package for The Movie Database (TMDb) https://www.themoviedb.org

Requirements

  • Swift 5.6

Installation

Swift Package Manager

Add the TMDb package as a dependency to your Package.swift file, and add it as a dependency to your target.

// swift-tools-version:5.6

import PackageDescription

let package = Package(
  name: "MyPackage",
  dependencies: [
    .package(url: "https://github.com/adamayoung/TMDb.git", upToNextMajor: "8.0.0")
  ],
  targets: [
    .target(name: "MyPackage", dependencies: ["TMDb"])
  ]
)

Setup

Get an API Key

Create an API Key from The Movie Database web site https://www.themoviedb.org/documentation/api.

Set your API Key

Set your API key before making any calls

TMDbAPI.setAPIKey("<tmdb-api-key>")

API Areas

Certifications

Get an up to date list of the officially supported movie certifications on TMDb.

Configuration

System wide configuration information.

Discover

Discover movies by different types of data like average rating, number of votes, genres and certifications.

Discover TV shows by different types of data like average rating, number of votes, genres, the network they aired on and air dates.

Movies

Get information about movies.

People

Get information about people.

Search

Search for movies, TV shows and people.

Trending

Get the daily or weekly trending items. The daily trending list tracks items over the period of a day while items have a 24 hour half life. The weekly list tracks items over a 7 day period, with a 7 day half life.

TV Shows

Get information about TV shows.

TV Show Seasons

Get information about TV show seasons.

Examples

First, set your TMDb API key.

TMDbAPI.setAPIKey("<tmdb-api-key>")

Discover Movies

let discoverService = TMDbAPI.shared.discover

let movieList = try await discoverService.movies()
let movies = movieList.results

Trending TV Shows this week, 2nd page

let trendingService = TMDbAPI.shared.trending

let tvShowList = try await trendingService.tvShows(inTimeWindow: .week, page: 2)
let tvShows = list.results

Popular People

let personService = TMDbAPI.shared.person

let personList = try await personService.popular()
let people = personList.results

Support for Combine

Combine support is available in version 6.0.0.

Documentation

The latest documentation for the TMDb APIs is available at https://adamayoung.github.io/TMDb.

References

License

This library is licensed under the Apache License 2.0. See LICENSE for details.

GitHub

link
Stars: 12
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

8.0.0
1 week ago

What's Changed

Full Changelog: https://github.com/adamayoung/TMDb/compare/7.1.0...8.0.0

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics