Market Hours Template
- Next.js
- TypeScript
Which stock exchanges are open right now, and when the others open, in your own time zone.
A Next.js app that shows world stock market hours at a glance. Nine exchanges, from New York and London to Hong Kong and Sydney, each with its open or closed state, a countdown to the next open or close, and its trading session drawn on a strip of your day in your own time zone. Use it as a trader's dashboard, or lift the route to show market status in your own app.

What it does
- Open right now
- A live headline counts the open markets, and each row shows a countdown to its next open or close.
- Your time zone
- Sessions are converted from each exchange's zone into the viewer's, with the local exchange hours alongside.
- Weekends and holidays
- The API says when an exchange is shut for the weekend or a holiday, and the board shows the reason.
- One call an hour
- The nine exchanges load in one cached answer, and the page keeps the countdowns live on its own.
- Keeps your key private
- The browser only talks to your own API route, which holds the key and limits each visitor to 10 lookups a minute.
How it works
The route: it asks Stock Market Open Times about every exchange at once and caches the answer.
/** GET /api/markets: today's session for every exchange on the board, in one cached answer. */
export async function GET(request: Request) {
const hit = fromCache('markets', TTL_MS);
if (hit) return Response.json(hit);
const blocked = guard(request);
if (blocked) return blocked;
return respond(async () => {
const data = await Promise.all(EXCHANGES.map((exchange) => callApi<Market>('stockmarketopentimes', { query: { exchange } })));
toCache('markets', data);
return data;
});
}Deploy it
- Get a free API key
The free plan includes 200 credits a month, no card needed. Create your key.
- Deploy it
Click Deploy to Vercel. Vercel copies the repo to your GitHub account and asks for
APIVERVE_API_KEY: paste your key there. - Open your app
Vercel builds it and gives you a live URL, usually in about a minute. Every push to the repo redeploys it.
Try the Stock Market Open Times API — the call this template makes
No key required to try it. Get a key to use it in your app.
{
"status": "ok",
"error": null,
"data": {
"timezone": "America/New_York",
"exchange": "NYSE",
"fullName": "New York Stock Exchange",
"isOpen": false,
"openingTime": "2026-11-06 09:30:00",
"closingTime": "2026-11-06 16:00:00",
"status": "closed",
"holidayName": null,
"localTime": "2026-11-06 01:26:52",
"isHalfDay": false,
"earlyCloseTime": null,
"nextChange": "open",
"nextOpen": "2026-11-06T09:30:00-05:00",
"nextClose": "2026-11-06T16:00:00-05:00",
"minutesUntilChange": 484,
"calendarVerified": true
}
}