NewAPIVerve Academy: free courses and certifications anyone can verify.Explore the Academy →

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.

The market hours app running

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.

app/api/markets/route.ts
/** 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;
  });
}

See the whole file on GitHub →

Deploy it

  1. Get a free API key

    The free plan includes 200 credits a month, no card needed. Create your key.

  2. Deploy it

    Click Deploy to Vercel. Vercel copies the repo to your GitHub account and asks for APIVERVE_API_KEY: paste your key there.

  3. 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

Request
GETapi.apiverve.com/v1/stockmarketopentimes?exchange=nyse
Query parameters
Verification
Format

No key required to try it. Get a key to use it in your app.

Example
{
  "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
  }
}

Build your own with Stock Market Open Times. Start with 200 free credits. One key unlocks all 300+ APIs.

Explore the catalog

300+ APIs on the same key and the same response shape.

Browse all APIs