Skip to main content
This guide shows how to build a price ticker that stays current throughout the NGX trading day. Because equity prices refresh every 20 minutes on our end, polling every 5 minutes gives you fresh data without wasting quota. Endpoints used:
  • GET /companies (Free plan) — fetch prices for all or filtered stocks
  • GET /companies/:symbol (Starter plan) — fetch a single stock’s full quote

How it works

  1. Fetch current prices on page load
  2. Re-fetch on a fixed interval (5 minutes recommended)
  3. Display the updated values — highlight the change direction if you like
  4. Stop polling when the user leaves or the page unmounts
The last_updated field in every response tells you exactly when the price was last written, so you can show users how fresh the data is.

Fetch prices for a watchlist

Use GET /companies with a search or sector filter, or just fetch the full list and filter client-side.

Sample response (trimmed)

Poll on an interval (vanilla JavaScript)

JavaScript

React component

React

Tips

Choose the right polling interval. Data refreshes every 20 minutes during trading hours, so polling more frequently than every 5 minutes won’t give you fresher prices — it just uses quota. Outside trading hours you can stop polling entirely. Check last_updated before re-rendering. If the timestamp hasn’t changed since your last poll, the price hasn’t moved and you can skip the DOM/state update. Only poll during trading hours. NGX trades Monday–Friday, 09:00–16:00 WAT. You can detect this client-side and pause the interval outside those windows:
JavaScript

Companies list reference

All parameters for GET /companies

Company detail reference

Full quote fields from GET /companies/:symbol