Skip to main content

Market Timings

API to retrieve the market timings for each exchange for a particular date.

Request

curl --location 'https://api.upstox.com/v2/market/timings/2024-01-22' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'

For additional samples in various languages, please refer to the Sample code section on this page.

Path Parameters

NameRequiredTypeDescription
datetruestringThe date for retrieving market timing information. Format: 'YYYY-MM-DD'.
Responses

Response Body

{
"status": "success",
"data": [
{
"exchange": "MCX",
"start_time": 1704079800000,
"end_time": 1704108600000
},
{
"exchange": "NSE",
"start_time": 1704080700000,
"end_time": 1704103200000
},
{
"exchange": "NFO",
"start_time": 1704080700000,
"end_time": 1704103200000
},
{
"exchange": "CDS",
"start_time": 1704079800000,
"end_time": 1704108600000
},
{
"exchange": "BSE",
"start_time": 1704080700000,
"end_time": 1704103200000
},
{
"exchange": "BCD",
"start_time": 1704079800000,
"end_time": 1704108600000
},
{
"exchange": "BFO",
"start_time": 1704080700000,
"end_time": 1704103200000
}
]
}
NameTypeDescription
statusstringA string indicating the outcome of the request. Typically success for successful operations.
dataobjectData object holding information about the market timings
data[].exchangestringExchange for which the market is open. Valid exchanges can be found in the Exchange Appendix
data[].start_timenumberTimestamp at which market will start.
data[].end_timenumberTimestamp at which market will end.

Sample Code

Get market timings of a date

import requests

url = 'https://api.upstox.com/v2/market/timings/2024-01-22'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {your_access_token}'
}

response = requests.get(url, headers=headers)

if response.status_code == 200:
data = response.json()
# Process the JSON response
print(data)
else:
print("Failed to retrieve data. Status code:", response.status_code)
Loading...