# Market state The market state endpoint provides real-time information on the operational status of all available stock exchanges. It returns data on whether each exchange is currently open or closed, along with the time remaining until the next opening or closing. This endpoint is useful for users who need to monitor exchange hours and plan their trading activities accordingly. **API credits cost:** `1` per request ## Parameters - `exchange` (string, optional) The exchange name where the instrument is traded. - `code` (string, optional) The Market Identifier Code (MIC) of the exchange where the instrument is traded. - `country` (string, optional) The country where the exchange is located. Takes country name or alpha code. ## Response - `` (array of object) - `name` (string) The full name of exchange - `code` (string) Market identifier code (MIC) under ISO 10383 standard - `country` (string) Country where the exchange is located - `is_market_open` (boolean) Indicates if the market is currently open - `time_after_open` (string) Time after market opening in HH:MM:SS format; if currently closed - returns 00:00:00 - `time_to_open` (string) Time to market opening in HH:MM:SS format; if currently open - returns 00:00:00 - `time_to_close` (string) Time to market closing in HH:MM:SS format; if currently closed - returns 00:00:00 ## Example Request ```bash curl "https://api.twelvedata.com/market_state?apikey=demo" ``` ## Example Response ```json [ { "name": "NYSE", "code": "XNYS", "country": "United States", "is_market_open": true, "time_after_open": "02:39:03", "time_to_open": "00:00:00", "time_to_close": "05:20:57" } ] ```