# js-omdb-api

> omdbapi library for javascript

Latest version **0.3.0** (published 2017-05-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install js-omdb-api
pnpm add js-omdb-api
yarn add js-omdb-api
bun add js-omdb-api
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2017-05-07 |
| First published | 2016-11-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Koen Van Geert |
| Maintainers | koenvg |
| Keywords | omdbapi |

## Links

- npm: https://www.npmjs.com/package/js-omdb-api
- Repository: https://github.com/koenvg/omdbapi
- Homepage: https://github.com/koenvg/omdbapi#readme
- Issues: https://github.com/koenvg/omdbapi/issues
- npm.io page: https://npm.io/package/js-omdb-api

## Dependencies (1)

- [whatwg-fetch](https://npm.io/package/whatwg-fetch.md) ^1.0.0

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.3.0 (latest) — 2017-05-07
- 0.2.0 — 2017-05-01
- 0.1.0 — 2016-11-13
- 0.0.6 — 2016-11-06
- 0.0.5 — 2016-11-06
- 0.0.4 — 2016-11-06
- 0.0.3 — 2016-11-05
- 0.0.2 — 2016-11-05
- 0.0.1 — 2016-11-05

## README

# omdbapi for the browser
This is a small javascript library for the [omdbapi](http://www.omdbapi.com/).</br>
It is ment to be used in the browser. 
It can be used in nodejs as well but then you will need to adjust the fetch package.

## features
- Typescript support
- Promise api

## Installation
```
npm install --save js-omdb-api
```

## Usage
### Find a show by imdb ID
``` Typescript
import { findById } from "js-omdb-api";

findById("tt0944947", {
  contentType: '',                // "movie" | "series" | "episode"
  year: '',                       // string
  plot: '',                       // string
  includeTomatoesRating: true,    // boolean
}).then((result) => {
  console.log(result);
}).catch((error) => {
  console.log(error);
}));
```

### Find a show by imdb ID and get all season information
``` Typescript
import { findByIdWithSeasons } from "js-omdb-api";

findByIdWithSeasons("tt0944947")
  .then(result => {
    console.log(result.seasons[0].episodes);
  });
```

### Find a show by title
``` Typescript
import { findByTitle } from "js-omdb-api";

findByTitle("Game of Thrones", {
  contentType: '',                // "movie" | "series" | "episode"
  year: '',                       // string
  plot: '',                       // string
  includeTomatoesRating: true,    // boolean
}).then((result) => {
  console.log(result);
}).catch((error) => {
  console.log(error);
}));
```

### search
``` Typescript
import { search } from "js-omdb-api";

search("Thrones", {
  contentType: '',                // "movie" | "series" | "episode"
  year: '',                       // string
  page: 1                         // number
}).then((result) => {
  console.log(result);
}).catch((error) => {
  console.log(error);
}));
```

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