1.0.2 • Published 4 years ago

imdb-scrapi v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

IMDb scrAPI

Build
Status

A minimal API for getting data off of IMDb using Puppeteer.

Can be served from the CLI or integrated into an existing node application.

I created this application because of a use case where I wanted to be able to get movie/tv related information periodically without needing an API key. This solution is slow, but suits my needs.

Endpoints

MethodEndpointBodyFunctionDescription
POST/searchquery: string (required) type: "movies", "tv", "episode" (optional)queryImdbExecutes a search query on IMDb and returns the results it gets.
POST/tv/seasonsimdbId: string (required)getSeasonsReturns an array with a number for each season it can find on IMDb. Will throw an error when the passed idmbId does not belong to a TV Show.
POST/tv/episodes/allimdbId: string (required)getAllEpisodesGets a list of all known episodes for this TV Show
POST/tv/episodes/seasonimdbId: string (required) season: number (required)getEpisodesForSeasonGets a list of all episodes for the given season of TV Show
POST/tv/episodes/latestimdbId: string (required)getMostRecentEpisodeGets the most recently aired episode for this TV Show
POST/tv/episodes/releasedimdbId: string (required)getAllReleasedEpisodesGets all released episodes for a TV SHow
POST/tv/episodes/upcomingimdbId: string (required)getUpcomingEpisodeGets the upcoming episode for this TV Show (if any are found)

CLI

Installation

NPM:

npm i -g imdb-scrapi

Yarn:

yarn add -g imdb-scrapi

Usage

Serve the API

imdb-scrapi serve

Options

Options set as CLI arguments will take precedent over options specified in the config.json. | Option | Description | Type | Default | | ------------- |------------- | -----: | -----: | | --port, -p | The port the application will listen to | number | 5000 |

As a module

Installation

NPM:

npm i imdb-scrapi

Yarn:

yarn add imdb-scrapi

Implement in your own project

The following methods are available for you to bind to your own routes or use elsewhere in your project.