# mdblist-lib

> mdblist.com API integration

Latest version **1.0.2** (published 2022-05-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install mdblist-lib
pnpm add mdblist-lib
yarn add mdblist-lib
bun add mdblist-lib
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-05-17 |
| First published | 2022-05-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=14.16 |
| Dependencies | 1 |
| Unpacked size | 21.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | fatshotty |
| Maintainers | fatshotty |

## Links

- npm: https://www.npmjs.com/package/mdblist-lib
- Repository: https://github.com/fatshotty/mdblist-lib
- Homepage: https://github.com/fatshotty/mdblist-lib#readme
- Issues: https://github.com/fatshotty/mdblist-lib/issues
- npm.io page: https://npm.io/package/mdblist-lib

## Dependencies (1)

- [got](https://npm.io/package/got.md) ^11.0.0

## Recent versions

- 1.0.2 (latest) — 2022-05-17
- 1.0.1 — 2022-05-08
- 1.0.0 — 2022-05-05

## README

# Installation

`npm install mdblist-lib`


# Usage

```js
const {MDBList} = require('mdblist-lib');


const MDB = new MDBList( YOUR_API_KEY_HERE );


async function getIceAge() {

    let res = await MDB.search('ice age', null, 'show');
    console.log( JSON.stringify(res, null, 2) );

    res = await MDB.byImdbID( res.search[0].imdbid );
    console.log( JSON.stringify(res, null, 2) );

}
getIceAge();
```


### Methods

`search( title : string, year? : number, type? : MDBListMediaType )`

search by `title` and `year`.
Returns `Promise<MDBListSearchResponse>`

`byImdbID( ID: string )`

get infos by IMDB_ID
Returns `Promise<MDBListItem>`

`byTmdbID( ID: string )`

get infos by TMDB_ID
Returns `Promise<MDBListItem>`

`byTvdbID( ID: string )`

get infos by TVDB_ID
Returns `Promise<MDBListItem>`

`byTraktID( ID: string )`

get infos by TRAKT_ID
Returns `Promise<MDBListItem>`



### Types


###### MDBListMediaType
```js
'movie' | 'show';
````

###### MDBListProvider
```js
'imdb' | 'tmdb' | 'tvdb' | 'trakt'
```


###### MDBListSearchResponse
```js
search: MDBListSearchItem[]
total: number;
````

###### MDBListSearchItem

```js
id: string;
title: string;
year: number;
score: number;
type: MDBListMediaType;
imdbid: string | null;
traktid: number | null;
tmdbid?: number;
tvdbid?: number;
```

###### MDBListItem

```js
released: string;
description: string;
runtime: number;
tmdbid: number;
language: string,
country: string,
certification: string,
commonsense: string | null,
status: string,
trailer: string,
poster: string,
backdrop: string,
apiused: number
```

---
_Source: https://npm.io/package/mdblist-lib · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
