Hi,

I'm new to getting info from a website and rendering it but have been asked by a potential employer to create such a feature on a website. What would be useful is if someone could point me in the right direction and possibly some scripts to look at?

Cheers.

Dani AI

Generated

For : a pragmatic, reliable approach is to use a market-data API rather than parsing exchange pages. As suggested, scraping is possible, but it is fragile, often breaks when the site layout changes, and can violate terms of service. APIs give structured JSON/XML, rate limits and clear licensing — ideal for production.

Good places to start:

  • Alpha Vantage (free tiers, simple JSON endpoints): Alpha Vantage documentation.
  • IEX Cloud (focused on US equities like NASDAQ): .
  • Nasdaq Data Link (formerly Quandl) for curated datasets and some index data: Nasdaq Data Link.

Typical workflow: register for an API key, call the endpoint for the symbol you need, parse the JSON, cache results server-side for a sensible interval, and display. Cache aggressively (file, memcached, Redis) to avoid hitting rate limits and to improve page performance. Be aware that index tickers (FTSE) may be exposed differently than stock tickers — check the provider’s coverage for indices and any delayed-vs-real-time distinctions.

Example PHP outline (very small, adapt and harden for production):

$url = 'https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=MSFT&apikey=YOUR_KEY';
$json = file_get_contents($url);
$data = json_decode($json, true);
if (!empty($data['Global Quote'])) {
    $price = $data['Global Quote']['05. price'];
    // cache and format for display
}

Troubleshooting & cautions: confirm licensing if the site is commercial; handle API errors and empty results; normalize timezones and market hours; and if you must scrape, use a headless browser for JS sites, strict caching, and check robots.txt and the site’s terms. For low-latency, licensed real-time feeds from exchanges are required.

It sounds as if you need to do some screen-scraping. See this previous post for some references.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.