Contents Lesson 4 of 16

8 min read · foundations

First data on screen, and the meter that shows what it cost

Time to see something real. Your own instruments go on screen with live-ish prices, and beside them a number most tutorials never show you: how much of today's allowance you just spent.

One request for the whole list

The naive watchlist fetches each ticker separately: twelve instruments, twelve calls. The real endpoint takes the first ticker in the path and the rest in s:

/real-time/AAPL.US?s=MSFT.US

Captured live on 2026-08-25, that returns both instruments in one response:

[{"code":"AAPL.US","timestamp":1787603280,"open":311.47,"high":313.36,"low":309.97,
  "close":310.34,"volume":32510925,"previousClose":309.35,"change":0.99,"change_p":0.32},
 {"code":"MSFT.US","timestamp":1787603220,"open":483.205,"high":490.605,"low":481.86,
  "close":487.31,"volume":15668481,"previousClose":483.24,"change":4.07,"change_p":0.8422}]

Everything a watchlist row needs is there: close is the current price, change and change_p are the move since previousClose, and timestamp is when the exchange produced it.

The trap, and it is a real one: with one ticker and no s parameter the endpoint returns a bare object, not an array of one. Code written against two tickers works fine and breaks the day someone trims the list to one. Handle both shapes from the start:

const body = await res.json();
const rows = Array.isArray(body) ? body : [body];

This is the kind of thing an assistant gets wrong when it is guessing and right when it is wired to the real API — the point of the previous lesson.

The number nobody shows you

Every plan has a daily call allowance. Most tutorials pretend it does not exist, so you meet it for the first time when your tool stops working on a morning you needed it.

The account endpoint tells you where you stand:

/user

It returns your plan, how many calls you have made today, and your limit — alongside your email, your payment method and an invite token. Surface only the three meter fields. Your watchlist has no business rendering your email address, and a /api/usage route that forwards the whole object is a small leak waiting to be screenshotted.

return Response.json({
  plan: u.subscriptionType,
  used: u.apiRequests,
  dailyLimit: u.dailyRateLimit,
});

Put that on screen from day one, not as decoration but as instrumentation. Two things become visible immediately: what a page view actually costs you, and how expensive a page that refreshes every five seconds turns out to be.

Requests are not calls

This distinction is the one that decides whether your arithmetic is right, and the API's own limits page states it plainly: "An API request is not the same as an API call; API calls are a form of 'currency' used to make requests."

A request is one HTTP round trip. A call is what it costs. Measured against the live API on 2026-08-26:

Endpoint Calls per request
/user 0 — the meter is free
/eod, /div, /splits, /exchange-symbol-list 1, whatever the row count
/real-time 1 per symbol — a ten-symbol request costs ten
/screener, /news, /technical, intraday 5
/fundamentals, options, bond fundamentals 10

Read the second and third rows together: forty-five years of daily bars is one call, while ten live quotes is ten — whether you ask in ten requests or in one.

Measure the ones you use rather than trusting this table. Pricing changes, and a table in a lesson goes stale.

So a watchlist costs length × reloads. Both axes are real, and the next lesson is about the one most people get wrong.

Say how old the number is

A price with no timestamp is a price you cannot trust. The response carries one, so use it: compute the age and print it.

Data age: 3 min old · 09:48 UTC

Read it from the response's own timestamp rather than from your plan's name. The plan name is a claim about what you should be getting; the timestamp is evidence about what you got. Those two disagree more often than you would like — a market can be closed, a feed can lag — and only one of them is checkable.

This small habit is what makes unit 4 honest. When you meet the freshness wall, you will not be told about it in a sales panel; you will read it off your own screen.

Connect your data

Everything so far can run on the cached, read-only feed the academy provides, which costs you nothing and is there so your first win needs no setup at all.

This is the point to switch. Get a free key, put it in .env.local, restart, and the numbers on your screen become your numbers, drawn against your allowance. From here to the end of the course you are working with your own account — including, in unit 4, its limits.

Try it now

Get your watchlist rendering three instruments and the usage meter on the same screen. Then watch the meter while you reload the page ten times, and write the number down. That figure — calls per page view — is the one that decides whether your tool can refresh every minute or only every hour, and you will need it in unit 4.