@ehicks05/tmdb-api
v0.1.12
Published
A more convenient way to interact with the most common tmdb endpoints.
Downloads
17
Readme
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
- Add the api key to your env
- Grab the library
npm i @ehicks05/tmdb-api - 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 }); - 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
- TMDB rate limit info
- TMDB's
/discoverendpoints (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.
