All Projects → worr → Node Imdb Api

worr / Node Imdb Api

A non-scraping, functional node.js interface to imdb (mirror of gitlab.com/worr/node-imdb-api)

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Node Imdb Api

square-java-sdk
Java client library for the Square API
Stars: ✭ 39 (-87.58%)
Mutual labels:  api-client
pixela
Pixela API client for Ruby
Stars: ✭ 23 (-92.68%)
Mutual labels:  api-client
Php Curl Class
PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs
Stars: ✭ 2,903 (+824.52%)
Mutual labels:  api-client
jarling
A Java Library for the Starling Bank API
Stars: ✭ 14 (-95.54%)
Mutual labels:  api-client
bitmovin-go
Golang-Client which enables you to seamlessly integrate the new Bitmovin API into your existing projects
Stars: ✭ 49 (-84.39%)
Mutual labels:  api-client
connect
CLI tool and Go client library for the Kafka Connect REST API
Stars: ✭ 45 (-85.67%)
Mutual labels:  api-client
dataiku-api-client-python
Python client for the DSS public API
Stars: ✭ 32 (-89.81%)
Mutual labels:  api-client
Aiodocker
Python Docker API client based on asyncio and aiohttp
Stars: ✭ 288 (-8.28%)
Mutual labels:  api-client
pyiiko
Pyiiko is the easy-to-use library for iiko API
Stars: ✭ 14 (-95.54%)
Mutual labels:  api-client
Pymisp
Python library using the MISP Rest API
Stars: ✭ 254 (-19.11%)
Mutual labels:  api-client
python-egnyte
Python client for the Egnyte Public API.
Stars: ✭ 16 (-94.9%)
Mutual labels:  api-client
fusionauth-node-client
Node.js client library for FusionAuth
Stars: ✭ 22 (-92.99%)
Mutual labels:  api-client
kaggler
🏁 API client for Kaggle
Stars: ✭ 50 (-84.08%)
Mutual labels:  api-client
enasearch
A Python library for interacting with ENA's API
Stars: ✭ 17 (-94.59%)
Mutual labels:  api-client
Hubspot Php
HubSpot PHP API Client
Stars: ✭ 273 (-13.06%)
Mutual labels:  api-client
douban-imdb-api
一个基于豆瓣、IMDB、烂番茄评分的电影电视剧双语(中英)数据api接口
Stars: ✭ 351 (+11.78%)
Mutual labels:  imdb
dwolla-v2-node
Official Node Wrapper for Dwolla's API: https://developers.dwolla.com/api-reference/
Stars: ✭ 30 (-90.45%)
Mutual labels:  api-client
Malsub
A Python RESTful API framework for online malware analysis and threat intelligence services.
Stars: ✭ 308 (-1.91%)
Mutual labels:  api-client
Insomnia
The open-source, cross-platform API client for GraphQL, REST, and gRPC.
Stars: ✭ 18,969 (+5941.08%)
Mutual labels:  api-client
cl-kraken
A Common Lisp API wrapper for the Kraken cryptocurrency exchange.
Stars: ✭ 12 (-96.18%)
Mutual labels:  api-client

node-imdb-api

A non-scraping, functional node.js interface to imdb

Badges

NPM version pipeline status Dependency Freshness coverage report Join the chat at https://gitter.im/worr/node-imdb-api

NOTE ON GITTER: I am online! I use the matrix bridge to talk on Gitter, so you'll see me talking through MatrixBot. Feel free to ask questions!

Github / Gitlab

Gitlab is the official upstream, and commits are mirrored to Github. I look at issues and PRs/MRs on both. Feel free to contribute on either.

API Docs

API docs are now here

Use

Import the library using require

const imdb = require('imdb-api')

or ES6 import

import imdb from 'imdb-api'

Call get to get a single movie

imdb.get({name: 'The Toxic Avenger'}, {apiKey: 'foo', timeout: 30000}).then(console.log).catch(console.log);

Movie {
  title: 'The Toxic Avenger',
  ...
}

Furthermore if you already know the id you can call get with different args:

imdb.get({id: 'tt0090190'}, {apiKey: 'foo'}).then(console.log);

Movie {
  title: 'The Toxic Avenger',
  ...
}

You can search for movies, and get multiple results by using the search function.

imdb.search({
  name: 'Toxic Avenger'
}, {
  apiKey: 'foo'
}).then(console.log).catch(console.log);

TV shows have an episodes method that you can use to fetch all of the episodes from that TV series.

imdb.get({name: 'How I Met Your Mother'}, {apiKey: 'foo'}).then((things) => {
    return things.episodes()
}).then((eps) => {
    console.log(eps);
});

Episode {
  season: 2,
  name: 'The Scorpion and the Toad',
  released: '2006-10-25T07:00:00.000Z',
  episode: 2,
  rating: '8.3',
  imdbid: 'tt0869673' },
...

Using a Client object

imdb-api also exported a Client object that you can use to store options for subsequent requests.

import imdb = require('imdb');
const cli = new imdb.Client({apiKey: 'xxxxxx'});
cli.get({'name': 'The Toxic Avenger'}).then(console.log);

Client also has a search method for searching.

import imdb = require('imdb');
const cli = new imdb.Client({apiKey: 'xxxxxx'});
cli.search({'name': 'The Toxic Avenger'}).then((search) => {
  for (const result of search.results) {
    console.log(result.title);
  }
});

FAQ

I see an API key in your examples? Is it required? How do I get one?

Yes, it is required! omdb made this a requirement as of May 8, 2017. This is unfortunate, but totally understandable. While I plan on working on finding an alternative to provide the movie info you crave, I've enabled you to pass in an apikey.

You can get one by going here.

Why? There are like 3 other interfaces to imdb in npm

Most of them scrape imdb. imdb explicitly forbids scraping.

And what happens when the site layout changes? Well then your screen scraping solution fails in interesting ways. Screen scraping is also pretty slow, and we can't have that.

WOAH I looked at your code and you're using unofficial APIs!

There isn't an official API to imdb. As soon as one is released (and I notice), I'll update the module.

imdb DOES release all of their data in text files nightly, so unofficial sites have popped up providing RESTful APIs against that data.

I have to use a few, since none of them are complete.

What if one of the unofficial APIs disappears?

File a bug. I'll get creative.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].