Exchange trading calendar
GET /api/market-calendarIs 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.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
exchange | string (one of: NYSE, LSE, XETRA, JPX, HKEX) | yes | exchange name or MIC (XNYS, XLON, XETR, XJPX, XHKG) |
at | string | no | optional ISO 8601 instant (default now) |
date | string | no | optional 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
GET /api/market-calendar$0.001 USDCPAYMENT-SIGNATUREon 14 chains200 OKAgent402-ReceiptEd25519Example 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"
}| Field | Type | Always present | In the example |
|---|---|---|---|
exchange | string | yes | NYSE |
at | string | yes | 2026-11-27T17:30:00.000Z |
localDate | string | yes | 2026-11-27 |
localTime | string | yes | 12:30 |
isOpen | boolean | yes | true |
today | object | yes | 4 fields: date, tradingDay, earlyClose, sessions |
nextOpen | string | yes | 2026-11-30T14:30:00.000Z |
nextClose | string | yes | 2026-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
exchangeis required. An input the tool rejects returns an HTTP 4xx whose body carrieserror,tool,expected,requiredandexample, so the caller can correct it.- A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement runs after the tool and only on a successful response. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Free tier: no outbound network call leaves the server for this tool, so proof-of-work (16 leading zero bits of sha256) pays for it.
- A
POSTwith a JSON body to /api/market-calendar is served as this GET, with the body as the input. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB is not replayed).
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
Bank holidays for a country and year (optionally one region): the days the holiday dataset tags as bank holidays.
Cross-border 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
Holiday-aware business days for a country or region: check whether a date is a business day, add or subtract N business.
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
Upcoming holidays in a country over the next 365 days, soonest first, optionally narrowed to one region and to holiday.
Public holidays
Public holidays for a country and year from an open public-holiday dataset (keyless, 100+ countries): observed date.