New trading hours tools are now available on TradingHours.com. Check it out »

Stock Market API StockMarketClock

Full Access to Stock Market Trading Hours API

Timely information is the key to successful trading and that begins with knowing exactly when markets are open around the world.

The StockMarketClock API that powers this site is now available for use in your project. StockMarketClock offers a simple RESTful API that can be easily integrated into your new or existing trading tools. Our API is built using industry standard best practices which allows you to use the API with existing tools like AJAX, cURL, or your programming language of choice.

Monthly Subscription

Full Access to the API
Flexible monthly subscription

19.99 / mo

Start 7-Day Trial

Yearly Subscription

Full access to the API
Simple yearly subscription

$199.00 / yr (Save 20%)

Get Access Now

Instant access, 100% money-back guarantee, and cancel at anytime.

Secure Stripe Payment Processing


  • Provides accurate opening and closing time for 70+ stock exchanges
  • Immediately get your API key with a 100% money-back guarantee
  • All holiday closures and special hours are taken into account
  • Please contact us to inquire about receiving additional data or other special requests

Usage

There are two endpoints available

First is the list endpoint which enumerates all available stock exchanges:

https://www.stockmarketclock.com/api-v1/list
{
    "results": [
        "adx",
        "aim",
        "amex",
        "ase-amman",
        "ase-athens",
        "asx",
        "bc",
        "bcba",
        "bde-barbados",
        "bhb",
        "bist",
        "bme",
        "bmv",
        "bovespa",
        "bse-beirut",
        "bse-bombay",
        "bse-budapest",
        "bsx",
        "bvb",
        "bvc",
        "bvl",
        "bvs",
        "bx",
        "cse",
        "cse-colombo",
        "dfm",
        "dse",
        "egx",
        "eurex",
        "euronext",
        "euronext-paris",
        "fsx",
        "gpw",
        "hkex",
        "hnx",
        "hose",
        "idx",
        "ise",
        "jpx",
        "jse",
        "jse-jamaica",
        "kase",
        "krx",
        "lse",
        "luxse",
        "moex",
        "mse",
        "mta",
        "myx",
        "nasdaq",
        "nse-india",
        "nse-nairobi",
        "nse-nigeria",
        "nyse",
        "nzx",
        "omx",
        "omxc-copenhagen",
        "omxh-helsinki",
        "omxr-riga",
        "ose",
        "otc",
        "pex",
        "pse",
        "psx",
        "qe",
        "sem",
        "set",
        "sgx",
        "six",
        "sse",
        "szse",
        "tadawul",
        "tase",
        "tse",
        "tsx",
        "twse",
        "ux",
        "vse",
        "zse"
    ]
}

Second is the status endpoint which returns the real-time stock exchange open/closed status:

https://www.stockmarketclock.com/api-v1/status?exchange=nyse,jpx
{
    "results": {
        "nyse": {
            "name": "New York Stock Exchange",
            "status": "closed",
            "reason": null,
            "until": "Mon, 19 Nov 2018 14:30:00 +0000",
            "timezone": "America/New_York"
        },
        "jpx": {
            "name": "Tokyo Stock Exchange",
            "status": "closed",
            "reason": null,
            "until": "Mon, 19 Nov 2018 00:00:00 +0000",
            "timezone": "Asia/Tokyo"
        }
    }
}

Code Examples

<?php

$endpoint  = 'https://www.stockmarketclock.com/api-v1/status';
$markets   = ["nyse", "jpx"];
$api_token = "YourApiKeyHere";

// Please follow proper format for your user agent
// https://en.wikipedia.org/wiki/User_agent#Format_for_automated_agents_(bots)
$userAgent = "UserAgentForYourScript/1.0";

$curl = curl_init($endpoint);
$curl_post_data = [
    'exchange'  => join(",", $markets),
    'api_token' => $api_token,
];
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data);
curl_setopt($curl, CURLOPT_USERAGENT, $user_agent);

$curl_response = curl_exec($curl);
if ($curl_response === false) {
    $info = curl_getinfo($curl);
    curl_close($curl);
    die('error occurred during curl exec. Additional info: ' . var_dump($info));
}
curl_close($curl);
$decoded = json_decode($curl_response, true);
if (isset($decoded->response->status) && $decoded->response->status == 'ERROR') {
    die('error occurred: ' . $decoded->response->errormessage);
}
var_dump($decoded);

?>
import urllib
from urllib2 import Request, urlopen, URLError

# Please follow proper format for your user agent
# https://en.wikipedia.org/wiki/User_agent#Format_for_automated_agents_(bots)

request = Request('https://www.stockmarketclock.com/api-v1/status', headers={'User-Agent' : "UserAgentForYourScript/1.0"})
data = urllib.urlencode({
	'exchange': 'nyse,jpx',
	'api_token': 'YourApiKeyHere'
})

try:
	response = urlopen(request,data)
	results = response.read()
	print results
except URLError, e:
	print 'There was an error:', e
import urllib.request, urllib.parse, urllib.error
from urllib.request import Request, urlopen
from urllib.error import URLError

# Please follow proper format for your user agent
# https://en.wikipedia.org/wiki/User_agent#Format_for_automated_agents_(bots)

request = Request('https://www.stockmarketclock.com/api-v1/status', headers={'User-Agent' : "UserAgentForYourScript/1.0"})
data = urllib.parse.urlencode({
	'exchange': 'nyse,jpx',
	'api_token': 'YourApiKeyHere'
})

try:
	response = urlopen(request,data)
	results = response.read()
	print(results)
except URLError as e:
	print('There was an error:', e)

Looking for a different language? Contact us.

Frequently Asked Questions

Is there a Rate Limit?

In order to ensure the availability of this API for all customers, we implement a rate limiting scheme that prevents high bursts of traffic. Users are limited to 1,000 requests per minute. This should be more than enough for any application, but if you need more requests for any reason, please contact us.


How will I receive my API key?

After subscribing you will be able to login to manage you account. In your account settings API you will be able to set up an API key.


I'm not sure how to use the API

We are here to help. If you need help integrating the API into your application, contact us for a free consultation.


Disclaimer and Terms

Please read the terms and conditions for a description of the data included and the disclaimer of liability. We provide this data on an as-is basis, and while we take all measures to ensure accuracy and completion we cannot be held liable for the contents of the data provided. We provide a 100% money-back guarantee if you are dissatisfied with your order for any reason.


Our Customer Feedback:

"Thank you! This is exactly what I was looking for.. You saved us a lot of time. Thanks again for the great customer service!"

Dave W., Ph.D.

"Your API was a big help for our business. The price is fair for what you get."

Allen C.