Skip to content

Exchange trading calendar

FREE with proof-of-workor $0.001 in USDCGET /api/market-calendar

Is an exchange open at a given moment, and when does it next open and close: NYSE, London Stock Exchange, Xetra, JPX (Tokyo) or HKEX, from each exchange's own published holidays, early closes and session hours, with the day's sessions in local time and UTC and the closures in the next month. Send GET /api/market-calendar with the required field exchange and pay $0.001 per call over x402 or MPP, or call it free by solving a proof-of-work challenge. It returns a JSON object with exchange, at, localDate, localTime, isOpen and 3 more.

Calendar facts only, no market data.

Category: Time & schedulingTags: market-hours trading-calendar exchange stock-market holidays finance

Try in playground →

Parameters

NameTypeRequiredDescription
exchangestring (one of: NYSE, LSE, XETRA, JPX, HKEX)yesexchange name or MIC (XNYS, XLON, XETR, XJPX, XHKG)
atstringnooptional ISO 8601 instant (default now)
datestringnooptional YYYY-MM-DD: that local day's schedule instead of an instant

Example request

curl -i "https://agent402.tools/api/market-calendar?exchange=NYSE&at=2026-11-27T17%3A30%3A00Z"

Without payment this returns HTTP 402 Payment Required with the exact price for market-calendar; any x402 v2 or MPP client pays it and retries.

Watch a call get paid

RequestGET /api/market-calendar
402$0.001 USDC
SignPAYMENT-SIGNATURE
Settleon 14 chains
Answer200 OK
ReceiptAgent402-ReceiptEd25519

Example response

{
  "exchange": "NYSE",
  "at": "2026-11-27T17:30:00.000Z",
  "localDate": "2026-11-27",
  "localTime": "12:30",
  "isOpen": true,
  "today": {
    "date": "2026-11-27",
    "tradingDay": true,
    "earlyClose": "13:00",
    "sessions": [
      {
        "open": "09:30",
        "close": "13:00",
        "openUtc": "2026-11-27T14:30:00.000Z",
        "closeUtc": "2026-11-27T18:00:00.000Z"
      }
    ]
  },
  "nextOpen": "2026-11-30T14:30:00.000Z",
  "nextClose": "2026-11-27T18:00:00.000Z"
}
FieldTypeAlways presentIn the example
exchangestringyesNYSE
atstringyes2026-11-27T17:30:00.000Z
localDatestringyes2026-11-27
localTimestringyes12:30
isOpenbooleanyestrue
todayobjectyes4 fields: date, tradingDay, earlyClose, sessions
nextOpenstringyes2026-11-30T14:30:00.000Z
nextClosestringyes2026-11-27T18:00:00.000Z

From an MCP client

catalog.call {
  "slug": "market-calendar",
  "params": {
    "exchange": "NYSE",
    "at": "2026-11-27T17:30:00Z"
  }
}

On the hosted connector at https://agent402.tools/mcp, catalog.call runs market-calendar free (rate-limited, no wallet). Local install: npx -y agent402-mcp@0.14.0.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.001" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/market-calendar?exchange=NYSE&at=2026-11-27T17%3A30%3A00Z");

No wallet? Pay with compute

Fetch a challenge, solve the sha256 puzzle (16 leading zero bits, a fraction of a second of CPU), and resend with the X-Pow-Solution header:

import { createHash } from "node:crypto";
const lz = (b) => { let t = 0; for (const x of b) { if (!x) { t += 8; continue; } t += Math.clz32(x) - 24; break; } return t; };
const c = await (await fetch("https://agent402.tools/api/pow/challenge?slug=market-calendar")).json();
let n = 0;
while (lz(createHash("sha256").update(c.challenge + ":" + n).digest()) < c.difficulty) n++;
await fetch("https://agent402.tools/api/market-calendar?exchange=NYSE&at=2026-11-27T17%3A30%3A00Z", { method: "GET", headers: { "X-Pow-Solution": c.token + ":" + n } });

Related tools

Bank holidays

$0.001GET /api/bank-holidays

Bank holidays for a country and year (optionally one region): the days the holiday dataset tags as bank holidays.

Cross-border business-day planner

$0.003GET /api/business-day-planner

First dates on or after a start date that are business days in every listed country or region at once (up to 6, e.g.

Business days by country

$0.002GET /api/country-business-days

Holiday-aware business days for a country or region: check whether a date is a business day, add or subtract N business.

Long weekends

$0.001GET /api/long-weekends

Long weekends in a country's year, computed from its public holidays: every run of 3 or more consecutive days off that.

Next holidays

$0.001GET /api/next-holidays

Upcoming holidays in a country over the next 365 days, soonest first, optionally narrowed to one region and to holiday.

Public holidays

$0.001GET /api/public-holidays

Public holidays for a country and year from an open public-holiday dataset (keyless, 100+ countries): observed date.