Skip to main content

History

POST /api/v1/history​

Endpoint URL​

This API Function to fetch historical data from the Broker

Hosted URL   :  POST https://imc.layr0.org/api/v1/history

Sample API Request​

{
"apikey": "<your_app_apikey>",
"symbol": "NIFTY31JUL25FUT",
"exchange": "NFO",
"interval": "1m",
"start_date": "2025-06-26",
"end_date": "2025-06-27",

}

Sample API Response​

{
"data": [
{
"close": 25292,
"high": 25302.1,
"low": 25272.3,
"oi": 5401650,
"open": 25302,
"timestamp": 1750909500,
"volume": 1042
},
{
"close": 25298,
"high": 25301,
"low": 25287.6,
"oi": 5401650,
"open": 25288.9,
"timestamp": 1750909560,
"volume": 462
},
{
"close": 25303,
"high": 25310.1,
"low": 25298.1,
"oi": 5401650,
"open": 25298.9,
"timestamp": 1750909620,
"volume": 429
}
],
"status": "success"
}

Request Body​

ParametersDescriptionMandatory/OptionalDefault Value
apikeyApp API keyMandatory-
symbolTrading symbolMandatory-
exchangeExchange codeMandatory-
intervalcandle interval (see supported values)Mandatory-
start_dateStart date (YYYY-MM-DD)Mandatory-
end_dateEnd date (YYYY-MM-DD)Mandatory-

Response Fields​

FieldTypeDescription
timestampnumberUnix epoch timestamp
opennumberOpening price
highnumberHigh price
oinumberOpen Interest
lownumberLow price
closenumberClosing price
volumenumberTrading volume

Notes​

  1. Always check supported intervals first using the intervals API
  2. Use exact interval strings from intervals API response
  3. All timestamps are in Unix epoch format

Error Responses​

  • 401 Unauthorized: Invalid/expired broker session or unauthorized.
  • 403 Forbidden: Invalid IMC API key or permission error.
  • 429 Too Many Requests: Rate limit exceeded (where detectable).
  • 500 Internal Server Error: Unclassified internal failure.

See also: HTTP Status Codes for detailed meanings.