I'm looking for ways to fetch live data from a stock exchange that doesn't provide an API. Is scraping the data in real-time a viable option, or are there alternative methods I should consider?
4 Answers
Scraping is pretty risky, especially if you're dealing with investments. If you can, it’s probably better to look for a stock exchange that offers similar rates but with a reliable API instead.
APIs definitely exist, but they’re often not public and come at a high cost for real-time data. Usually, they’re only accessible to high-frequency traders. For personal use, you might have to settle for a delay of 15-20 minutes with services like Google or Yahoo Finance.
Using a third-party API is usually the way to go, but be prepared to pay quite a bit, and even then, you're likely looking at a delay of around 15 minutes with sources like Polygon or Massive.
Unfortunately, if there's no API available, you might be out of luck. Stock exchanges are protective of their data, and scraping can trigger their anti-bot measures, leading to more headaches down the line. You might want to consider focusing on a different project.

Related Questions
How to Build a Custom GPT Journalist That Posts Directly to WordPress
Cloudflare Origin SSL Certificate Setup Guide
How To Effectively Monetize A Site With Ads