flotwig / imdb-scraper

:movie_camera: IMDb.com scraper using Express (to expose an API), Redis (for caching), and Cheerio (for parsing)
https://imdb-scraper.herokuapp.com/
1 stars 1 forks source link

imdb-scraper

This is an API which scrapes the Internet Movie Database for movie and TV show information. It supports both searching for movies and retrieving movies by ID. There is also a caching layer implemented in Redis.

Using the API

The API has a public endpoint at https://imdb-scraper.herokuapp.com/ where the following functions can be found. You can also run your own instance if you wish.

search - search IMDb titles

Request

GET /search?q=Game+of+Thrones&limit=20

Response

See example: https://imdb-scraper.herokuapp.com/search?q=Game+of+Thrones&limit=20

title - get a single title

Request

GET /title?id=tt0182576

Response

See example: https://imdb-scraper.herokuapp.com/title?id=tt0182576

API errors

If there is an error with your request, a message following this format will be returned:

{
    "success": false,
    "error": "Some error message here."
}

Running the API

This API is written in TypeScript and the files in build/ are auto-generated by tsc -w. Run npm start to start build/index.js.

To enable debug output on errors, set the DEBUG environment variable.

To use Redis for caching, set the REDIS_URL environment variable to one parsable by the NodeJS redis library.