All Projects → MoviebaseApp → tmdb-api

MoviebaseApp / tmdb-api

Licence: Apache-2.0 License
This Kotlin Multiplatform library is for accessing the TMDB API to get movie and TV show content. Using for Android, iOS, and JS projects.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to tmdb-api

kotlin-multiplatform-example
A Kotlin multiplatform example app that targets Android, ReactJS, iOS, JavaFx, and Spring Boot
Stars: ✭ 115 (+270.97%)
Mutual labels:  kotlin-js, kotlin-native, kotlin-multiplatform
MovieCards
React App that uses TMDb API to display movie data. Try it out! ->
Stars: ✭ 38 (+22.58%)
Mutual labels:  movie, tmdb, tmdb-api
MultiplatformPlayground
Kotlin Multiplatform project in Jetpack Compose & SwiftUI with shared ViewModel layer and File upload
Stars: ✭ 72 (+132.26%)
Mutual labels:  ktor, kotlin-native, kotlin-multiplatform
kinsight-multiplatform
Kotlin Multiplatform Concept - iOS, MacOS, WatchOS (SwiftUI), Android (phone and Wear OS), JVM Web Server - Alpha Capture
Stars: ✭ 38 (+22.58%)
Mutual labels:  ktor, kotlin-native, kotlin-multiplatform
ToDometer Multiplatform
WIP Kotlin Multiplatform project: A meter to-do list built with Android Jetpack, Compose UI Multiplatform, Wear Compose, SQLDelight, Koin Multiplatform, SwiftUI, Ktor Server / Client, Exposed...
Stars: ✭ 145 (+367.74%)
Mutual labels:  multiplatform, ktor, kotlin-multiplatform
kmm-production-sample
This is an open-source, mobile, cross-platform application built with Kotlin Multiplatform Mobile. It's a simple RSS reader, and you can download it from the App Store and Google Play. It's been designed to demonstrate how KMM can be used in real production projects.
Stars: ✭ 1,476 (+4661.29%)
Mutual labels:  multiplatform, kotlin-native, kotlin-multiplatform
thelema-engine
Thelema - 3D graphics engine, written in Kotlin. Based on sources of libGDX.
Stars: ✭ 51 (+64.52%)
Mutual labels:  kotlin-js, kotlin-native, kotlin-multiplatform
KotlinMultiplatformAndoridParcelize
Use the Parcelize Annotation of the Kotlin Android Extensions in Kotin Multiplatform projects
Stars: ✭ 16 (-48.39%)
Mutual labels:  kotlin-js, kotlin-native, kotlin-multiplatform
Sheasy
This an Android App that helps you share/manage your files on your Android Device through a WebInterface in the Browser - Built with Ktor and Kotlin-React
Stars: ✭ 34 (+9.68%)
Mutual labels:  kotlin-js, ktor, kotlin-multiplatform
tv-maniac
Tv-Maniac is a Multiplatform app (Android & iOS) for viewing TV Shows from TMDB.
Stars: ✭ 55 (+77.42%)
Mutual labels:  ktor, kotlin-multiplatform, ktor-client
kfsm
Finite State Machine in Kotlin
Stars: ✭ 76 (+145.16%)
Mutual labels:  kotlin-js, kotlin-native, kotlin-multiplatform
auto-movie-tagger
A Python script that auto tags and adds poster to mkv or mp4 movie files.
Stars: ✭ 49 (+58.06%)
Mutual labels:  movie, tmdb, tmdb-api
moko-network
Network components with codegeneration of rest api for mobile (android & ios) Kotlin Multiplatform development
Stars: ✭ 107 (+245.16%)
Mutual labels:  kotlin-native, kotlin-multiplatform, ktor-client
kgql
GraphQL Document wrapper generator for Kotlin Multiplatform Project and Android
Stars: ✭ 54 (+74.19%)
Mutual labels:  multiplatform, kotlin-native, kotlin-multiplatform
laravel-tmdb
Interact with TMDB data in your Laravel application.
Stars: ✭ 25 (-19.35%)
Mutual labels:  tmdb, tmdb-api, tmdb-rest-api
inventum
Android client for TMDb
Stars: ✭ 22 (-29.03%)
Mutual labels:  movie, tmdb
SQLiter
Minimal multiplatform sqlite library
Stars: ✭ 120 (+287.1%)
Mutual labels:  kotlin-native, kotlin-multiplatform
kmm
Rick & Morty Kotlin Multiplatform Mobile: Ktor, Sqldelight, Koin, Flow, MVI, SwiftUI, Compose
Stars: ✭ 52 (+67.74%)
Mutual labels:  ktor, kotlin-multiplatform
meu kumbu
💵Meu Kumbu 💰 (Means My Money) is a template app that people can use to build their owns Wallet 🤑 or a mobile 🏦 banking app.
Stars: ✭ 55 (+77.42%)
Mutual labels:  ktor, kotlin-multiplatform
hello-kotlin-multiplatform
Multiplatform Kotlin Hello World (Android/Java/JavaScript)
Stars: ✭ 64 (+106.45%)
Mutual labels:  kotlin-js, kotlin-multiplatform

Website | Forum | Documentation | TMDb 3 API

TMDb

Get movie and TV show content from TMDb in a fast and simple way.

Maven Central Build Status Issues Kotlin Gradle GitHub License


TMDb API

This library gives access to TMDb API version 3 and 4 for mobile, desktop, and web applications. It supports Swift, Kotlin, and JavaScript by setting up as a Kotlin Multiplatform project.

This library is mainly used and supported by Moviebase.

Adding to your project

The library is available on Maven Central.

Gradle

Add the Maven Central repository if it is not already there.

repositories {
    mavenCentral()
}

To use the library in a single-platform project, add a dependency.

dependencies {
    implementation("app.moviebase:tmdb-api:0.6.5")
}

In Kotlin Multiplatform projects, add the dependency to your commonMain source-set dependencies.

commonMain {
    dependencies {
        implementation("app.moviebase:tmdb-api:0.6.5")
    }
}

Maven

Add a dependency to the <dependencies> element.

<dependency>
    <groupId>app.moviebase</groupId>
    <artifactId>tmdb-api</artifactId>
    <version>0.6.5</version>
</dependency>

Usage

Most of the library follows the possibilities and naming at the official TMDb documentation.

The documentation of the endpoints can be found in Version 3 and Version 4.

Get information

For getting basic information about a movie or other media content.

val tmdb = Tmdb3("apiKey")
val movieDetail = tmdb.movies.getDetails(
    movieId = 12,
    language = "DE",
    appendResponses = listOf(AppendResponse.MOVIE_CREDITS)
)

Search

Search for TV shows by a query.

val tmdb = Tmdb3("apiKey")
val showPageResult = tmdb.search.findShows(
    query = "The Expanse",
    page = 1,
    language = "DE",
    region = "US",
    includeAdult = false
)

Discover

Discover a movie or TV show by the discover parameter class.

val discover = TmdbDiscover.Movie(
    sortBy = TmdbDiscoverMovieSortBy.POPULARITY,
    sortOrder = TmdbSortOrder.DESC,
    voteAverageGte = 5,
    voteCountGte = 200,
    releaseDate = TmdbDiscoverTimeRange.BetweenYears(from = 2020, to = 2021)
)

val discoverPageResult = tmdb.discover.discoverMovie(
    page = 1,
    region = "DE",
    language = "de",
    discover = discover
)

Alternatively, use predefined discover categories like upcoming, networks or on streaming.

val discoverCategory = DiscoverCategory.OnStreaming.Netflix(
    mediaType = TmdbMediaType.MOVIE,
    watchRegion = "DE"
)

val result = tmdb.discover.discoverByCategory(
    page = 1,
    region = "DE",
    language = "de",
    category = discoverCategory
)

Build image URL

You can build an image URL via the poster file path and size key. More information on the TMDb images site.

val url = TmdbImageUrlBuilder.build("nBNZadXqJSdt05SHLqgT0HuC5Gm.jpg", "w154")

Or create the URL by an image class with the best matched width/height.

val url = TmdbImageUrlBuilder.build(image = movie.posterImage, width = 200, height = 300)

For creating the poster URL by the movie item.

val url = TmdbImageUrlBuilder.buildPoster(item = movie, width = 200)

Build video URL

You can build a video URL by the key value into TmdbVideo. TMDb API currently support videos from YouTube and Vimeo

val youtubeTmdbVideo = TmdbVideo(id = "123", key = "qwerasdf", site = TmdbVideoSite.YOUTUBE)
val url = TmdbImageUrlBuilder.build(youtubeTmdbVideo) // It will return `https://www.youtube.com/watch?v=qwerasdf`

val vimeoTmdbVideo = TmdbVideo(id = "123", key = "qwerasdf", site = TmdbVideoSite.VIMEO)
val url = TmdbImageUrlBuilder.build(vimeoTmdbVideo) // It will return `https://vimeo.com/qwerasdf`


This library uses the TMDb but is not endorsed or certified by TMDb. These services are licensed under CC BY-NC 4.0.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].