stock market holidays

How To Use The Stock Market Holidays API

Use the stock market holidays API to get the open or closed status for any date in the past, present or future.

April 27, 2023
    Add a header to begin generating the table of contents

    Use the stock market holidays api to get the open/closed status for any day in the past, present, or future. The market status endpoint will return either “open” or “closed” depending on whether there was trading activity on the date(s) requested.

    By default Market Data’s API uses Unix timestamps. However, for improved readability, we’ve prepared this article below using human-readable timestamps. Using the optional dateformat parameter, you can control how Market Data outputs dates in all endpoints.

    Consulting Today’s Open/Closed Status

    Endpoint: https://api.marketdata.app/v1/markets/status/

    If you call the endpoint without any optional parameters, it will provide a response about the current trading day in the United States:

    {"s": "ok","date":["2023-04-27"],"status": ["open"]}

    Getting The Market Status for a Range of Dates

    To verify the open/close status for a range of dates, just add the from and to parameters, as you would on the rest of the Market Data endpoints. This will return an array of dates and open/close status. Relative date keywords such as “today”, “yesterday”, “tomorrow” and “now” are also supported. Use countback together with “to” if you want a specific number of days Example queries:

    Stock Market Holidays API: Using The Country Parameter

    Only “US” is supported as a country parameter at this time. However, this will change as Market Data adds additional countries. For each country Market Data adds, the Market Status endpoint will be updated to include its holiday dates. This parameter can be safely omitted and the endpoint will assume the user is requesting the United States.

    Further Reading

    Share This Tutorial

    Comments & Questions