3 ms·
I asked an online shop I frequent if they have an API, as they discount some inventory sometimes, to which they responded there is no public API. It's easy enou
by PennRobotics 3y ago
I asked an online shop I frequent if they have an API, as they discount some inventory sometimes, to which they responded there is no public API. It's easy enough to find (using Inspect->Network->XHR) how they serve data, and with just five minutes of work, their raw JSON can be loaded in Python and polled for specific brands/categories/individual products, including anything flagged for a discount.
Programmatic? Yes. Against their wishes? Also, yes.
The guilt or bad feelings subsided after realizing I'll use more of their bandwidth how I was searching before via the browser. Using the API, I see when the last inventory update occurred, and only after this will I search their discount inventory.
(In any case, if they are on EC2, I cost them 3 to 8 cents per month, estimating high, which they have certainly recouped.)
- olig15 3y agoWhy have bad feelings at all. It’s a shop, and I’m assuming the end goal of you looking for discounts is to make purchases from that store?
- deleted 3y ago[deleted]
- 1vuio0pswjnm7 3y agoMore efficient. They could (incorrectly) call you a "bot" but that's simply not true. You are human. The amount of server resources you deplete is actually less than a modern graphical browser from an ad-sponsored team of software developers. However perhaps you are not looking at some ads or submitting yourself to tracking or telemetry. Under the W3C web ethics principles you can consume the data from the web in any way you like. It is your right to decide what HTTP requests you make. XHR/fetch in someone else's Javascript could be well-intentioned but too often it tries to take away some of that agency and transfer it to a web developer.
- PennRobotics 3y agoIt's not so clear-cut. I have a Gitlab action that checks for the update every hour and then emails me when a match is found, so I technically have employed a bot. It saves me time and saves them bandwidth. For tracking, they'll have to rely on old-fashioned "order history" and "inventory period". By these metrics, I would be baffled if they decided to block my access or close my account, even if I'm bypassing Google Tags/their AB test suite/social media analytics/ads for their other services. Ignoring their nonconsent feels impolite, but they can dry their tears with my spent money.