Website | Support | Documentation
Get movie and TV show content from Trakt.
Trakt API
This library is a lightweight Trakt API. 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:trakt-api:0.1.0")
}
In Kotlin Multiplatform projects, add the dependency to your commonMain source-set dependencies.
commonMain {
dependencies {
implementation("app.moviebase:trakt-api:0.1.0")
}
}
Maven
Add a dependency to the
element.
<dependency>
<groupId>app.moviebasegroupId>
<artifactId>trakt-apiartifactId>
<version>0.1.0version>
dependency>
Usage
Most of the library follows the possibilities and naming at the official Trakt documentation.
Get information
For getting basic information about a shows or other media content.
val trakt = Trakt("clientId")
val traktShow = trakt.shows.getSummary(traktSlug = "vikings")
Search
Search for TV shows by a query.
val trakt = Trakt("clientId")
val showPageResult = trakt.search.search(
searchType = TraktSearchType.TMDB,
id = "63639",
mediaType = TraktMediaType.SHOW
)
This library uses the Trakt but is not endorsed or certified by Trakt.