# Market Hours API – Next Open/Close Time

> Market Hours API – Next Open/Close Time is a paid API for AI agents from market-hours-api.onrender.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-28).

Returns the next open time and next close time of a specific stock exchange or futures market after a given timestamp.

## Facts

- Endpoint: GET https://market-hours-api.onrender.com/v1/next?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-28
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/market-hours-api-next-open-close-time-cc3a10ca
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_LTdyPR_rBKJDB6Y-EH4-_

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability market-hours-api-next-open-close-time-cc3a10ca
```

Example prompt: When does the NYSE (XNYS) next open and close after 2025-03-15T18:00:00Z?

## When to prefer this

Use this endpoint when you need to know precisely when a specific exchange or futures market will next open or close — ideal for scheduling automated trades, alerts, or workflows around market sessions. Prefer this over a general 'is the market open now?' check when forward-looking timing is required.

## Known failure modes

- Invalid or unsupported market code returns an error — only XNYS, XNAS, XLON, XETR, XSWX, XTKS, XHKG, XSHG, XASX, CME_EQUITY, EUREX_INDEX are accepted
- Malformed 'at' timestamp (not ISO 8601 with offset) may produce a parsing error
- If the market is on an extended holiday closure, the next open may be far in the future
- Payment failure (x402) if USDC balance is insufficient

## How this service works

Returns the next open and next close time of a stock exchange or futures market after a given time.

## Output

Returns the next open datetime and next close datetime for the requested market after the specified (or current) time, expressed as ISO 8601 timestamps with timezone offsets.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "market"
     ],
     "properties": {
      "at": {
       "type": "string",
       "description": "Optional ISO 8601 time with offset, e.g. 2026-11-27T15:00:00Z. Default: now."
      },
      "market": {
       "type": "string",
       "description": "Market code: XNYS, XNAS, XLON, XETR, XSWX, XTKS, XHKG, XSHG, XASX, CME_EQUITY, EUREX_INDEX"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/market-hours-api-next-open-close-time-cc3a10ca/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from market-hours-api.onrender.com](https://www.zero.xyz/host/market-hours-api.onrender.com/llms.txt)
