0.1.12 • Published 5 months ago

@ehicks05/tmdb-api v0.1.12

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

tmdb-api

Overview

A more convenient way to interact with the most common tmdb endpoints.

Features

  • Typed responses
  • A built-in rate limiter to avoid errors

Prereqs

An api key from TMDB.

Getting Started

  1. Add the api key to your env
  2. Grab the library
    npm i @ehicks05/tmdb-api
  3. Create and export the client:

    // ./src/tmdb.ts
    import { TmdbApi } from '@ehicks05/tmdb-api';
    
    const api_key = process.env.TMDB_API_KEY;
    export const tmdb = new TmdbApi({ api_key });
  4. Use it:

    // ./src/demo.ts
    import { tmdb } from './tmdb'
    
    async function printTitle() {
       const movie = await tmdb.movie({ id: 603 });
       console.log(movie.title); // The Matrix
    }
    
    printTitle();

Notes

  1. TMDB rate limit info
  2. TMDB's /discover endpoints (maybe all paginated endpoints?) are limited to 500 pages. So you'll have to use filters to bring the results under the limit to be able to see all results.
0.1.12

5 months ago

0.1.11

5 months ago

0.1.10

5 months ago

0.1.9

5 months ago

0.1.8

6 months ago

0.1.7

6 months ago

0.1.6

6 months ago

0.1.5

6 months ago

0.1.4

6 months ago

0.1.3

6 months ago

0.1.2

6 months ago

0.1.1

6 months ago

0.1.0

6 months ago