# Market Status & Trading Hours API - US, EU, Asia Exchanges (`ichigowa/market-status-api`) Actor

Is the stock market open right now? DST-correct open/closed status, trading hours, holidays and early closes for NYSE, NASDAQ, CME, LSE, XETRA, JPX and HKEX. Computed 2026-27 calendars, next open/close in UTC, normalized JSON per exchange.

- **URL**: https://apify.com/ichigowa/market-status-api.md
- **Developed by:** [kyle herman](https://apify.com/ichigowa) (community)
- **Categories:** Business, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 status rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Market Status & Trading Hours API — NYSE, NASDAQ, CME, LSE, XETRA, JPX, HKEX

**Is the stock market open right now?** This actor answers that question — correctly, across time zones and DST changes — for seven major world exchanges, and gives you machine-readable **trading hours**, **stock market holidays 2026-2027** and **early-close days** as normalized JSON.

A lightweight, dependency-free **market status API** / **trading hours API**: no scraping, no external calls. Everything is computed from embedded, curated exchange calendars with DST-correct session logic (Python `zoneinfo`).

### Supported exchanges

| Code | Exchange | Timezone | Regular session (local) |
|------|----------|----------|-------------------------|
| NYSE | New York Stock Exchange | America/New\_York | 09:30–16:00 |
| NASDAQ | NASDAQ Stock Market | America/New\_York | 09:30–16:00 |
| CME | CME Globex (equity index futures) | America/Chicago | Sun 17:00 → Fri 16:00, daily 16:00–17:00 break |
| LSE | London Stock Exchange | Europe/London | 08:00–16:30 |
| XETRA | Deutsche Börse Xetra | Europe/Berlin | 09:00–17:30 |
| JPX | Japan Exchange (TSE) | Asia/Tokyo | 09:00–11:30, 12:30–15:30 (lunch break) |
| HKEX | Hong Kong Exchanges | Asia/Hong\_Kong | 09:30–12:00, 13:00–16:00 (lunch break) |

### Input

All fields optional — run with `{}` to get all exchanges.

```json
{
  "exchanges": ["NYSE", "LSE", "JPX"],
  "days_ahead": 30
}
```

- `exchanges` — array of codes; empty = all seven.
- `days_ahead` — horizon for `upcoming_holidays` (default 30).

### Output — one row per exchange

```json
{
  "exchange": "NYSE",
  "exchange_name": "New York Stock Exchange",
  "timezone": "America/New_York",
  "local_time": "2026-09-02T18:10:44-04:00",
  "is_open_now": false,
  "current_session": "closed",
  "next_open_utc": "2026-09-03T13:30:00Z",
  "next_close_utc": "2026-09-03T20:00:00Z",
  "today_is_holiday": false,
  "holiday_name": null,
  "early_close_today": false,
  "upcoming_holidays": [
    { "date": "2026-09-07", "name": "Labor Day", "type": "closed", "confidence": "verified" }
  ],
  "sessions": [{ "open_local": "09:30", "close_local": "16:00" }],
  "as_of_utc": "2026-09-02T22:10:44Z",
  "confidence": "verified"
}
```

`current_session` is one of `regular`, `early_close_day`, `lunch_break`, `closed`. JPX and HKEX lunch breaks are modeled explicitly, so at 12:00 Tokyo time you get `lunch_break`, not a false "open".

### What's handled correctly

- **DST transitions** — sessions are defined in local exchange time and converted via IANA tz data, so `next_open_utc` shifts automatically when New York, London, or Berlin change clocks (Tokyo and Hong Kong don't observe DST — also handled).
- **Early closes** — US 1:00 pm ET closes (Black Friday, Christmas Eve), LSE 12:30 pm closes (Dec 24 / Dec 31), HKEX half-days (morning session only), CME 12:15 pm CT holiday halts.
- **Observed/substitute holidays** — e.g. July 4, 2026 (Saturday) → NYSE closed Friday July 3; UK Boxing Day 2026 → substitute Monday Dec 28.
- **Overnight futures sessions** — CME Globex Sun 17:00 → Fri 16:00 CT with the daily maintenance break.
- **Honest confidence flags** — deterministic dates are `"verified"`; lunar-calendar holidays (HK Lunar New Year, Buddha's Birthday, Dragon Boat, Mid-Autumn, Chung Yeung) and product-dependent CME early closes are `"estimated"`. We flag uncertainty instead of faking precision.

### Use cases

- Gate trading bots / order routers: *don't send orders when the venue is closed.*
- "Market open/close" countdowns and dashboards.
- Scheduling data pipelines around exchange sessions and stock market holidays 2026.
- Normalized multi-region calendar for fintech apps.

### Why this instead of a free US-only endpoint?

Free options exist for US markets only (e.g. Polygon's market status endpoint). This actor's value is **multi-exchange, normalized coverage** — one schema across US, UK, German, Japanese and Hong Kong venues, with lunch breaks, half-days, and substitute-holiday logic that generic holiday APIs get wrong.

### Notes & limitations

- Calendars embedded for **2026–2027**. Outside that window, weekday/session logic still works but holiday flags are unavailable.
- Ad-hoc closures (mourning days, disasters, typhoon signals at HKEX) cannot be predicted — always confirm with the exchange for anything money-critical.
- CME rows are always `"estimated"`: Globex holiday schedules vary by product group.

### Pricing

Pay-per-event: one `status-row` charge per exchange row pushed. A default run (all 7 exchanges) costs 7 events.

# Actor input Schema

## `exchanges` (type: `array`):

Exchange codes to report. Empty = all supported (NYSE, NASDAQ, CME, LSE, XETRA, JPX, HKEX).

## `days_ahead` (type: `integer`):

How many days ahead to list upcoming holidays / early closes (1-365).

## Actor input object example

```json
{
  "exchanges": [],
  "days_ahead": 30
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "exchanges": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("ichigowa/market-status-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "exchanges": [] }

# Run the Actor and wait for it to finish
run = client.actor("ichigowa/market-status-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "exchanges": []
}' |
apify call ichigowa/market-status-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ichigowa/market-status-api"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/pg1q1A7WXIFrgdo0Z/builds/3IczqKL1qzfZ4rLj4/openapi.json
