Intervals
Get available time intervals for historical data from the current broker.
Endpoint URL
Local Host : POST http://127.0.0.1:5000/api/v1/intervals
Ngrok Domain : POST https://<your-ngrok-domain>.ngrok-free.app/api/v1/intervals
Custom Domain: POST https://<your-custom-domain>/api/v1/intervalsSample API Request
{
"apikey": "<your_app_apikey>"
}Sample cURL Request
curl -X POST http://127.0.0.1:5000/api/v1/intervals \
-H 'Content-Type: application/json' \
-d '{
"apikey": "<your_app_apikey>"
}'Sample API Response
Request Body
apikey
Your OpenAlgo API key
Mandatory
-
IntervalsSchema declares only apikey. Any other field returns HTTP 400.
Response Fields
status
string
"success" or "error"
data
object
Available intervals by category
Data Object Fields
months
array
Monthly intervals (e.g., "M")
weeks
array
Weekly intervals (e.g., "W")
days
array
Daily intervals (e.g., "D")
hours
array
Hourly intervals (e.g., "1h", "2h")
minutes
array
Minute intervals (e.g., "1m", "5m", "15m")
seconds
array
Second intervals (e.g., "1s")
Common Interval Values
1m
1 minute
3m
3 minutes
5m
5 minutes
10m
10 minutes
15m
15 minutes
30m
30 minutes
1h
1 hour
D
Daily
W
Weekly
M
Monthly
The full set that /history will accept at the schema level is larger than this. What a given broker returns here is the subset it can actually serve.
Notes
Available intervals vary by broker
Always check available intervals before requesting History
Some brokers may not support all interval types
The response shows only intervals supported by your connected broker
Back to: API Documentation
Last updated