ontl / coda-pack-imdb

A pack for Coda.io that pulls in data from IMDB
https://coda.io/@nickhe/imdb-pack
9 stars 1 forks source link

Returning Error #2

Open joeynotjoe opened 2 years ago

joeynotjoe commented 2 years ago

Hello! For the past few days I've been unable to get any results, just returning "Error: ". I tried on the IMDb+ Pack example doc, and got the same result, so I'm pretty confident it's nothing in my use of the formula or pack, but the pack itself.

Capture 2022-08-31 at 08 49 51@2x

Thanks!

ontl commented 2 years ago

Yeah there's a daily API limit of 5k requests, and today there have been 20k requests. Someone (you? haha) has been getting good use out of the pack over the last couple weeks and sending us over the limit. I'll look to see if there's some way to throttle accounts so that at least the quota can be more equitably spread amongst the users, rather than taking the pack offline for the remainder of each day.

(I think you've already donated to support the API costs as well - thank you! Unfortunately at current total donation levels I'm not able to upgrade to the higher API tier just yet, which would also help alleviate this issue as well)

joeynotjoe commented 2 years ago

Wow, 20k requests 😮 I am pretty confident that's not me, haha. That's too bad. Is there a way to utilize a private API key?

ontl commented 2 years ago

Yes and no. The Pack uses two separate APIs to aggregate all its data: themoviedb.org (free but still need to register API key) and imdb-api.com (paid API key).

Packs are limited in what servers they can reach out to:

If I wanted to leave the API expense up to individual users, I wouldn't be able to collect 2 API keys from them (and you can't mix user- and server-authentication in one Pack).

I suppose I could hard-code the TMDB API credentials into the code itself (would have to redact from this repo, but it's an option), and then prompt users to register for their own imdb-api.com key. That felt like a much worse UX than having it just work. But it's also a bad UX to have the whole Pack run out of API quota so 😅

ontl commented 2 years ago

Oh I guess an option is to create your own Pack using the code from this repo, and then plug in your own credentials into the Pack admin settings. Unfortunately it's a multi-file Pack which means you need to use the CLI though, which requires more setup than just pasting the code into the Pack editor.

joeynotjoe commented 2 years ago

Thank you for that info! Yes, I was just running into that bit. I was like, how do I point this to .helpers? Haha. That makes more sense. I'll have to look into the CLI portion of this and see if I can figure that out. I would love to pay for my own imdb-api account so it's not an issue.