Skip to main content

Intervals

POST /api/v1/intervals​

Endpoint URL​

This API Function responds with supported broker timeframe interval for fetching historical data

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

Sample API Request​

{
"apikey": "<your_app_apikey>"
}

Sample API Response​

{
"data": {
"days": [
"D"
],
"hours": [
"1h",
"2h",
"4h"
],
"minutes": [
"10m",
"15m",
"1m",
"20m",
"2m",
"30m",
"3m",
"5m"
],
"months": [
"M"
],
"seconds": [
"10s",
"15s",
"30s",
"45s",
"5s"
],
"weeks": [
"W"
]
},
"status": "success"
}

Request Body​

ParametersDescriptionMandatory/OptionalDefault Value
apikeyApp API keyMandatory-

Response Fields​

FieldTypeDescription
secondsarrayList of supported second-based intervals
minutesarrayList of supported minute-based intervals
hoursarrayList of supported hour-based intervals
daysarrayList of supported daily intervals
weeksarrayList of supported weekly intervals
monthsarrayList of supported monthly intervals

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.