# 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.

Source: https://www.marketdata.app/api/stocks/stock-market-holidays/

---

(image: A pencil on a blue-tinted calendar page, crossed by a red band lettered MARKET HOLIDAYS.)

-   [Market Data API](/topics/api/)
-   [Stock Data](/topics/data/stocks/)
-   [Stock Market API](/topics/api/stocks/)
-   [Tutorials](/tutorials/)

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

-   Last updated April 18, 2024

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/](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:

-   All of 2020
    -   [https://api.marketdata.app/v1/markets/status/?from=2020-01-01&to=2020-12-31](https://api.marketdata.app/v1/markets/status/?from=2020-01-01&to=2020-12-31)
-   Yesterday through Tomorrow
    -   [https://api.marketdata.app/v1/markets/status/?from=yesterday&to=tomorrow](https://api.marketdata.app/v1/markets/status/?from=yesterday&to=tomorrow)
-   Last 7 Days, Including Today
    -   [https://api.marketdata.app/v1/markets/status/?to=today&countback=6](https://api.marketdata.app/v1/markets/status/?to=today&countback=6)

## 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

-   [Market Status API Reference Documentation](/docs/api/markets/status)
