https://github.com/newca12/tmdb-async-client
  
  
    Scala async wrapper for TMDb (The Movie Database) API 
    https://github.com/newca12/tmdb-async-client
  
api-client api-rest asynchronous movie-database scala tmdb
        Last synced: 28 days ago 
        JSON representation
    
Scala async wrapper for TMDb (The Movie Database) API
- Host: GitHub
- URL: https://github.com/newca12/tmdb-async-client
- Owner: newca12
- License: gpl-3.0
- Created: 2014-01-01T21:37:40.000Z (almost 12 years ago)
- Default Branch: without-X-RateLimit
- Last Pushed: 2023-03-30T12:29:24.000Z (over 2 years ago)
- Last Synced: 2025-03-28T21:35:22.179Z (7 months ago)
- Topics: api-client, api-rest, asynchronous, movie-database, scala, tmdb
- Language: Scala
- Homepage:
- Size: 150 KB
- Stars: 3
- Watchers: 3
- Forks: 3
- Open Issues: 0
- 
            Metadata Files:
            - Readme: README.md
- License: LICENSE
 
Awesome Lists containing this project
README
          # TMDb-async-client
[](https://github.com/newca12/TMDb-async-client/actions)
[](https://codecov.io/github/newca12/TMDb-async-client?branch=master)
[](https://maven-badges.herokuapp.com/maven-central/org.edla/tmdb-async-client_2.13)
### About ###
TMDb-async-client is a native Scala SDK that provides asynchronous access to [The Movie Database][1] (TMDb) API.  
It is built heavily on [akka-http][2] for async non-blocking HTTP I/O and [spray-json][3] for parsing JSON responses into Scala case classes.  
[akka-stream][4] is used to allow limitation of client request frequency and number of parallel requests in respect of TMDb policies.
TMDb-async-client is an EDLA project.
The purpose of [edla.org](http://www.edla.org) is to promote the state of the art in various domains.
### API Key ###
You will need an API key to The Movie Database to access the API.  To obtain a key, follow these steps:
1. Register for and verify an [account](https://www.themoviedb.org/account/signup).
2. [Log](https://www.themoviedb.org/login) into your account
3. Select the API section on left side of your account page.
4. Click on the link to generate a new API key and follow the instructions.
### Usage ###
See [Usage.scala](https://github.com/newca12/TMDb-async-client/blob/master/src/main/scala/org/edla/tmdb/client/Usage.scala) for a runnable example.
Each function returns a `Future` of the response from the TMDb API, parsed into a convenient case class.
``` scala
  val apiKey = "REPLACE_THIS_WITH_YOUR_OWN_API_KEY"
  val tmdbClient = TmdbClient(apiKey)
  val movie = tmdbClient.getMovie(54181)
  val movies = tmdbClient.searchMovie("shark")
  tmdbClient.downloadPoster(movie, Paths.get("/tmp/poster.jpg"))
  tmdbClient.shutdown
```
### Developers ###
API Key need to be available as an environment variable named apiKey if you want to run sbt test
### Related Projects ###
[JavaFX client for TMDb (The Movie Database) ](https://github.com/newca12/TMDb-shelf)
### License ###
© 2014-2021 Olivier ROLAND. Distributed under the GPLv3 License.
[1]: http://www.themoviedb.org/
[2]: http://doc.akka.io/docs/akka-http/current/scala/http/index.html
[3]: http://doc.akka.io/docs/akka-http/current/scala/http/common/json-support.html
[4]: http://doc.akka.io/docs/akka/2.4/scala/stream/stream-cookbook.html#Globally_limiting_the_rate_of_a_set_of_streams