bindarr icon indicating copy to clipboard operation
bindarr copied to clipboard

403 from tcgcsv

Open shadow431 opened this issue 1 month ago • 8 comments

Looks like bindarr had been blocked by tcgcsv for call volume.

Opened an MR to try and cut back the number of calls to tcgcsv and better fall in line with their usage guidelines here

Mostly by tracking the https://tcgcsv.com/last-updated.txt and not syncing unless that has rev'd since last sync. Spacing out the requests to not call as quickly. Adding a cache for responses from tcgcsv to reduce the need to call again.

MR #101

Sounds like there's also possibility for bindarr to host its own mirror of tcgcsv for the project to point to.

shadow431 avatar Oct 27 '26 00:10 shadow431

Same 403s from tcgcsv.com here (price update every hour, and the TCGplayer product map build fails). TCGdex, Scryfall and Lorcast all work, and so does scanning.

Possibly useful data point:

curl https://tcgcsv.com/tcgplayer/3/groups                        -> 200
curl -A "axios/1.7.0" https://tcgcsv.com/tcgplayer/3/groups       -> 401
docker exec bindarr node -e "fetch('https://tcgcsv.com/tcgplayer/3/groups').then(r=>console.log(r.status))"   -> 401

So it doesn't look like an IP block on my server. The same host gets through with plain curl but not from Node/axios, which might mean the block is keyed on how requests identify themselves. I'm not sure, though, and the app logs 403 where my probes got 401. Setting Refresh prices to Never for now.

danielnisbet avatar Nov 03 '26 18:11 danielnisbet

@danielnisbet I've been in contact with the maintainer of tcgcsv and they have block bindarr as a user agent due to the continuous volume of calls. this MR does stop the continual calls they where seeing before hand and reduces call volume some as well. Sounds like they would like bindarr to have its own mirror though. as part of the guidelines number 6 Don't make requests to TCGCSV directly from user-facing applications. which as this is self hosted we sorta run a gray line on that. I dont know what the process of setting up that mirror looks like though.

shadow431 avatar Nov 03 '26 19:11 shadow431

Update: #118 (TCGCSV daily sync: polite, cached, with a 403 cooldown) and #111 (a project-hosted mirror) are now merged into main. Together they are the fix for this, but the 403 itself isn't solved yet. The mirror is waiting for the TCGCSV maintainer to approve it, and until it's live, Pokémon TCGplayer prices can still go stale.

Meanwhile, you can set Refresh prices → Never, or point TCGCSV_BASE_URL at your own cache. I'm leaving this open until the mirror is live and verified.

🤖 Generated with Claude Code

thenotoriousJeremy avatar Nov 07 '26 14:11 thenotoriousJeremy

Can you use pokewallet.io as a fallback?

jimbo19922003 avatar Nov 07 '26 23:11 jimbo19922003

@shadow431 Bryan, I appreciate all your work on Bindarr. I feel like I owe you a coffee at this point. I'm figuring out how to set up a daily mirror action on GH so we stop hammering tcgcsv. Let them know I apologize. I tried to make the calls as efficient as possible but didn't anticipate the number of users! the edge build should have the plumbing we are looking for. I haven't had a chance to review thoroughly.

@jimbo19922003 definitely a good alternate. I feel like we keep hopping from provider to provider.

thenotoriousJeremy avatar Nov 08 '26 21:11 thenotoriousJeremy

No worries. I Love this project and I hope I'm adding value and not friction lol. I'm not sure what tcgcsv expects as a mirror. I did setup an nginx read through cache at home so my test/dev instance and "prod" instance we are using at home dont make more then one set of calls combined. I did send links for this issue and my MR to tcgcsv so i'll poke them to see if we can get some thought on mirroring method.

shadow431 avatar Nov 08 '26 21:11 shadow431

Oh hey! Yeah, sorry for the trouble.

Basically, from my perspective... 1 user agent occuring from over 20+ distributed IPs created a nearly endless drone of requests that never stopped. The network graph was a flat bar of continuous traffic. So I banned the user agent, and now we're here.

Image

Don't make requests to TCGCSV directly from user-facing applications.

which as this is self hosted we sorta run a gray line on that.

Exactly this... If there could be some way to install a mirror for the daily requests occurring, I'd appreciate it. The only other option is to provide a default UA that all Bindarr instances are required to override/change/customize for their runtime... but that just disseminates and obscures the load... If Bindarr is spreading as well as it is, I'd like to ask the developers here to come up with a solution de-duplicate the bandwidth this shared project is creating amongst themselves, rather than just have everyone silently load TCGCSV directly.

My AWS bill is surging past 1000$ a month. I'm supported very well on Patreon, and never want to place any of that burden on any individuals, but projects like this end up falling into this unfortunate grey-area when I perform my audits and see monumental amounts of traffic from "1 source"

CptSpaceToaster avatar Nov 08 '26 23:11 CptSpaceToaster

@CptSpaceToaster thank you for explaining, and I'm sorry about the bill. Below is the summary of changes (ai summarized):

The shared mirror is live as of today:

  • One GitHub Actions job syncs from TCGCSV once a day (23:17 UTC), serially at 200 ms or slower, with a hard cap of 4,500 requests. It identifies as BindarrMirror/<version> (+https://github.com/thenotoriousJeremy/bindarr), checks last-updated.txt first, and skips the run if nothing changed. A 403 or 429 stops it with no retry.
  • It publishes to the tcgcsv-mirror branch of this repo. The first run took 1,367 requests for categories 3 and 85. It now also covers 89, and 71 and 1 reduced to sealed product: 2,354 requests for one full daily sync of all five categories.
  • Bindarr 1.9.0, out today, reads from the mirror by default. No install on 1.9 contacts tcgcsv.com. Installs on older releases keep getting your 403, which is fine; the release notes and README tell people to upgrade or point TCGCSV_BASE_URL at the mirror.

If the mirror's request pattern or User-Agent needs to change, tell me here and I'll change it. Thanks again for TCGCSV.

Thanks also to @shadow431 for working this out with you.

thenotoriousJeremy avatar Nov 10 '26 02:11 thenotoriousJeremy