Skip to Content
Getting StartedAPI GuidesHistorical Market Data

Work with historical market data

Use historical data for charting, research, analysis and backtesting. Start by checking the available history and resolution for your plan.

Plan check Daily, intraday, Seconds Data and Expired F&O Data availability differs between Standard and Prime.

Before you begin

Step-by-step workflow

  1. Choose the instrument and time range

    Identify the instrument through Symbol Master and define the exact start and end period required for analysis.

  2. Select the required resolution

    Choose daily, intraday or seconds-level data according to the use case and plan availability. Avoid requesting a finer resolution than the analysis needs.

  3. Request historical candles

    Send the historical-data request with the verified symbol, resolution and date fields.

  4. Validate the returned period

    Check that the first and last candle match the requested trading period and that timestamps are interpreted using the documented time-zone rules.

  5. Handle missing or unavailable data

    Separate non-trading periods, unavailable history and invalid requests. Do not fill missing market data without a defined research rule.

  6. Store and reuse data responsibly

    Cache data where appropriate, retain the source and retrieval time, and avoid repeatedly requesting the same historical range.

  7. Verify the result

    Check the relevant API response and account or market-data state to confirm that the workflow completed successfully. If the result is partial or unsuccessful, review the returned status and message before deciding whether to retry or take another action.

Common issues

Authentication or permission failure401 Unauthorized

The access token is missing, expired, or the app does not have the required permission. Generate a fresh token and retry the request.

HTTP/1.1 401 Unauthorized
{"s":"error","code":-8,"message":"Could not authenticate the user"}
View Authentication →
Incorrect request inputs400 Bad Request

A required field is missing or invalid (symbol, quantity, side, or product type). Read the response message, correct the payload, then retry.

HTTP/1.1 400 Bad Request
{"s":"error","code":-50,"message":"Please provide valid order parameters"}
View Error Code Reference →
Plan or rate-limit restriction429 Too Many Requests

The request exceeded the plan’s rate limit or an entitlement. Back off before retrying and confirm the Standard vs Prime limits for the API you are calling.

HTTP/1.1 429 Too Many Requests
Retry-After: 1
{"s":"error","message":"Rate limit exceeded"}
Learn exponential backoff →
Temporary network or socket interruptionTimeout

The connection dropped before a response arrived. Check the latest order, position, or socket state before sending the same request again.

Error: socket hang up
ECONNRESET
View WebSocket Overview →

Continue with AI

Last updated on