Giter Site home page Giter Site logo

tuhinpal / imdb-api Goto Github PK

View Code? Open in Web Editor NEW
264.0 4.0 286.0 152 KB

Serverless IMDB API powered by Cloudflare Worker

Home Page: https://imdb-api.projects.thetuhin.com/

License: Apache License 2.0

JavaScript 99.61% Dockerfile 0.39%
imdb cloudflare-worker cloudflare-workers hono imdb-api movie-list web-scraping honojs

imdb-api's Introduction

Important Update: Project Discontinued ๐Ÿ””

IMDb has recently launched their official API, providing developers with authorized access to their database. Given this development, I've made the decision to discontinue maintenance of this project for the following reasons:

  1. To avoid potential conflicts with IMDb's terms of service and intellectual property rights.
  2. To encourage the use of officially supported and maintained data sources.

Recommendations for users of this project:

  1. Transition to IMDb's official API for the most up-to-date and reliable movie data.
  2. Consider using alternative sources like TMDB (The Movie Database) API as another robust option.

This repository will be archived to preserve the code for reference purposes. Thank you to all contributors and users for your support throughout this project's lifespan.

For any questions or concerns, please refer to IMDb's developer documentation or explore TMDB's API offerings.

IMDB API

Features ๐Ÿชถ

  • Search titles
  • Search by IMDB ID
  • Cacheable Result
  • High Performance
  • Get episode information
  • Get all reviews with full pagination supported

Installation ๐Ÿ“ฆ

If you anticipate sending a large number of requests, it is recommended that you deploy your own Cloudflare worker. Installation is pretty easy and straight forward. Click the button below to get started.

Deploy to Cloudflare Workers

After deployed, map the worker to a Domain Name to configure cache. Only Workers deployed to custom domains have access to functional cache operations.

Run with docker ๐Ÿ‹

  • Clone this repository
  • Build the image
    docker build -t imdb-api .
    
  • Start the process (Deatached)
    docker run -p 3000:3000 -it -d imdb-api
    

API ๐Ÿ“ก

Run in Postman

Endpoint Method Description Example
/search?query={query} GET Search titles by title Try It
/title/{imdb_id} GET Get details of a title Try It
/reviews/{imdb_id}?option={helpfulness|date|votes|rating}&sortOrder={asc|desc} GET Get reviews of a title Try It
/title/{imdb_id}/season/{season_id} GET (New) Fetch a single season of a series Try It
/user/{user_id} GET (New) Fetch an user's info Try It
/user/{user_id}/ratings?ratingFilter={1-10}&sort={most_recent|oldest|top_rated|worst_rated} GET (New) Fetch an user's ratings and reviews Try It

License ๐ŸŽฏ

Have a good day ๐Ÿค˜

imdb-api's People

Contributors

dependabot[bot] avatar spechide avatar tuhinpal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

imdb-api's Issues

[Bug] Can not run docker in local

Because of Cloudflare's resource limitations, I plan to run it on my VPS, but it failed to run. The log is as follows:

root@:~/imdb-api# docker run -p 3000:3000 -it imdb-api

> [email protected] start
> wrangler dev src/index.js --port 3000

 โ›…๏ธ wrangler 3.3.0 (update available 3.6.0)
-----------------------------------------------------
wrangler dev now uses local mode by default, powered by ๐Ÿ”ฅ Miniflare and ๐Ÿ‘ท workerd.
To run an edge preview session for your Worker, use wrangler dev --remote
โœ” Would you like to help improve Wrangler by sending usage metrics to Cloudflare? โ€ฆ no
Your choice has been saved in the following file: ../root/.config/.wrangler/metrics.json.

  You can override the user level setting for a project in `wrangler.toml`:

   - to disable sending metrics for a project: `send_metrics = false`
   - to enable sending metrics for a project: `send_metrics = true`
โŽ” Starting local server...
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ [b] open a browser, [d] open Devtools, [l] turn off local mode, [c] clear console, [x] to exit                                                                   โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
/app/node_modules/wrangler/wrangler-dist/cli.js:30632
            throw a;
            ^

Error: spawn /app/node_modules/@cloudflare/workerd-linux-64/bin/workerd ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:292:12)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /app/node_modules/@cloudflare/workerd-linux-64/bin/workerd',
  path: '/app/node_modules/@cloudflare/workerd-linux-64/bin/workerd',
  spawnargs: [
    'serve',
    '--binary',
    '--experimental',
    '--socket-addr=entry=0.0.0.0:3000',
    '--external-addr=loopback=localhost:40203',
    '--control-fd=3',
    '-',
    '--inspector-addr=127.0.0.1:40149'
  ]
}

Node.js v20.5.1

got "Too many requests error ยทยทยทโ€ message, but I only use it today

I deployed the service on CloudFlare as instructed in the readme, but I haven't managed it for two months.
Today, when I requested it for the first time, I found this response. Was my service requested multiple times? Or is it the requested interface by others?
{ "query": null, "results": [], "message": "Too many requests error from IMDB, please try again later" }

Is there any way to improve this? Please help me. Thanks

How to use the new cache?

I updated my fork with your new changes and the kv cache no longer works. I see you updated to use some other cache but I can't figure out how to use it. Getting a lot of non-json responses and errors due to the requests not being cached properly

Result not found

{"query":null,"results":[],"message":"Cannot read properties of undefined (reading 'childNodes')"}

in "/search?query=${query}"

some cors error is showing

i used this api in an imdb clone i made it used to work fine but now its showing cors error and im not getting any data

please add some item

hi ,
thank for your repo , please add language and country and award of film in results, or how to add this in our projects

Error in response

Hello i am getting the error below when using both your example url and also mine. please any solution?

{"query":null,"results":[],"message":"Unexpected token 'T', "Too many n"... is not valid JSON"}

IMDB removed ajax

https://www.imdb.com/title/tt5247622/episodes/_ajax?season=1

this doesnt work anymore, also scraping html is only good for first 50 episodes, then they use GraphQL with calculated hash like this:

curl 'https://caching.graphql.imdb.com/?operationName=TitleEpisodesSubPagePagination&variables=%7B%22after%22%3A%22dHQxMTA2NzY5Ng%3D%3D%22%2C%22const%22%3A%22tt5247622%22%2C%22filter%22%3A%7B%22includeSeasons%22%3A%5B%221%22%5D%7D%2C%22first%22%3A50%2C%22locale%22%3A%22en-GB%22%2C%22originalTitleText%22%3Afalse%2C%22returnUrl%22%3A%22https%3A%2F%2Fwww.imdb.com%2Fclose_me%22%7D&extensions=%7B%22persistedQuery%22%3A%7B%22sha256Hash%22%3A%22ecdbd1a3df08b6a3903b16662bc636e6cbaf6a6e4fcbf64496ab4da46b8038e2%22%2C%22version%22%3A1%7D%7D' \
  -H 'content-type: application/json' \
  --compressed

if you know how to calculate that hash would be good

/title API fails with "Worker exceeded resource limits" every time

Hi, thanks for making this project. Unfortunately after deploying to cloudflare workers, when using the /title endpoint, I seem to get "Worker exceeded resource limits" every time. Here's an example with the url I tried: https://imdb-api.aibotted849.workers.dev/title/tt6522580. It seems to happen 90% of the time with the worker in the readme too.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.