Skip to content

Historical Data API

Retrieve historical price data for specified instruments in OHLCV (Open, High, Low, Close, Volume) format with support for multiple timeframes and exchanges.

Overview

The Historical Data API provides access to comprehensive historical market data, enabling backtesting, technical analysis, and chart visualization. The API supports various timeframes from 1-minute to monthly intervals and includes optional Open Interest data for derivatives.

Endpoint Reference

Get Historical Candle Data

Retrieve historical OHLCV data for a specific instrument across configurable time intervals.

Endpoint Details

Method: GET
URL: /candle/:exchange/:token/:interval
Authentication: Required (appID + token)

URL Parameters

Parameter Type Required Description
exchange string Exchange identifier (nse, nfo, bse, etc.)
token string Unique instrument token (e.g., 3045 for SBIN)
interval string Candle interval (see supported intervals below)

Supported Intervals

Interval Description
min 1 minute
3min 3 minutes
5min 5 minutes
10min 10 minutes
15min 15 minutes
30min 30 minutes
hour 1 hour
2hours 2 hours
3hours 3 hours
4hours 4 hours
day 1 day
week 1 week
month 1 month

Query Parameters

Parameter Type Required Description
from string Start date/time in yyyy-MM-ddTHH:mm:ss format
to string End date/time in yyyy-MM-ddTHH:mm:ss format
oi integer Include Open Interest data (1=enabled, NFO only)

Request Headers

Header Type Required Description
appID string Your application identifier
token string User authentication token

NSE Historical Data

Retrieve historical equity data from the National Stock Exchange.

Request Example

    curl --location 'https://edge.arrow.trade/candle/nse/3045/day?from=2023-05-01T00:00:00&to=2023-06-29T20:00:00' \
    --header 'appID: <YOUR_APP_ID>' \
    --header 'token: <YOUR_TOKEN>'
    const exchange = 'nse';
    const token = '3045'; // SBIN
    const interval = 'day';
    const from = '2023-05-01T00:00:00';
    const to = '2023-06-29T20:00:00';

    const response = await fetch(
      `https://edge.arrow.trade/candle/${exchange}/${token}/${interval}?from=${from}&to=${to}`,
      {
        method: 'GET',
        headers: {
          'appID': '<YOUR_APP_ID>',
          'token': '<YOUR_TOKEN>'
        }
      }
    );

    const candles = await response.json();
    import requests

    exchange = 'nse'
    token = '3045'  # SBIN
    interval = 'day'
    from_time = '2023-05-01T00:00:00'
    to_time = '2023-06-29T20:00:00'

    headers = {
        'appID': '<YOUR_APP_ID>',
        'token': '<YOUR_TOKEN>'
    }

    url = f'https://edge.arrow.trade/candle/{exchange}/{token}/{interval}'
    params = {
        'from': from_time,
        'to': to_time
    }

    response = requests.get(url, headers=headers, params=params)
    candles = response.json()

Success Response

[
    [
        "2023-05-02T00:00:00+0530",
        58000,
        58085,
        57315,
        57530,
        13667511
    ],
    [
        "2023-05-03T00:00:00+0530",
        57065,
        57500,
        56900,
        57050,
        9699527
    ],
    [
        "2023-05-04T00:00:00+0530",
        57020,
        58080,
        56850,
        58000,
        12533761
    ],
    [
        "2023-05-05T00:00:00+0530",
        58020,
        58825,
        57504,
        57650,
        18163461
    ],
    [
        "2023-05-08T00:00:00+0530",
        57765,
        58760,
        57735,
        58360,
        12990869
    ],
    [
        "2023-05-09T00:00:00+0530",
        58500,
        58645,
        57210,
        57350,
        18959065
    ],
    [
        "2023-05-10T00:00:00+0530",
        57500,
        57500,
        56325,
        57220,
        18561315
    ]
]

Response Format (NSE)

Each candle is represented as an array with the following structure:

Index Field Type Description
0 Timestamp string Date/time in ISO 8601 format with timezone
1 Open integer Opening price × 100
2 High integer Highest price × 100
3 Low integer Lowest price × 100
4 Close integer Closing price × 100
5 Volume integer Total traded volume

Price Scaling for NSE

IMPORTANT: Open, High, Low, and Close values are multiplied by 100. To get actual prices, divide by 100.

Example:

    [
        "2023-05-02T00:00:00+0530",
        58000,
        58085,
        57315,
        57530,
        13667511
    ]
**Actual Values:**
- Open: ₹580.00 (58000 ÷ 100)
- High: ₹580.85 (58085 ÷ 100)
- Low: ₹573.15 (57315 ÷ 100)
- Close: ₹575.30 (57530 ÷ 100)
- Volume: 13,667,511 shares

NFO Historical Data

Retrieve historical derivatives data from the National Stock Exchange Futures & Options segment, with optional Open Interest information.

Request Example

    curl --location 'https://edge.arrow.trade/candle/nfo/41927/day?from=2024-03-05T00:00:00&to=2024-03-08T00:00:00&oi=1' \
    --header 'appID: <YOUR_APP_ID>' \
    --header 'token: <YOUR_TOKEN>'
    const exchange = 'nfo';
    const token = '41927';
    const interval = 'day';
    const from = '2024-03-05T00:00:00';
    const to = '2024-03-08T00:00:00';

    const response = await fetch(
      `https://edge.arrow.trade/candle/${exchange}/${token}/${interval}?from=${from}&to=${to}&oi=1`,
      {
        method: 'GET',
        headers: {
          'appID': '<YOUR_APP_ID>',
          'token': '<YOUR_TOKEN>'
        }
      }
    );

    const candles = await response.json();
    import requests

    exchange = 'nfo'
    token = '41927'
    interval = 'day'
    from_time = '2024-03-05T00:00:00'
    to_time = '2024-03-08T00:00:00'

    headers = {
        'appID': '<YOUR_APP_ID>',
        'token': '<YOUR_TOKEN>'
    }

    url = f'https://edge.arrow.trade/candle/{exchange}/{token}/{interval}'
    params = {
        'from': from_time,
        'to': to_time,
        'oi': 1
    }

    response = requests.get(url, headers=headers, params=params)
    candles = response.json()

Success Response (with Open Interest)

[
    [
        "2024-03-05T00:00:00+0530",
        26000,
        41505,
        21400,
        33330,
        2950530,
        487485
    ],
    [
        "2024-03-06T00:00:00+0530",
        28930,
        60000,
        25520,
        40705,
        13948425,
        1778205
    ],
    [
        "2024-03-07T00:00:00+0530",
        42400,
        44800,
        28810,
        32915,
        26726955,
        3863355
    ]
]

Response Format (NFO)

Each candle is represented as an array with the following structure:

Index Field Type Description
0 Timestamp string Date/time in ISO 8601 format with timezone
1 Open integer Opening price × 100
2 High integer Highest price × 100
3 Low integer Lowest price × 100
4 Close integer Closing price × 100
5 Volume integer Total traded volume
6 Open Interest integer Open Interest (only when oi=1)

Price Scaling and Open Interest for NFO

IMPORTANT: Open, High, Low, and Close values are multiplied by 100. To get actual prices, divide by 100.

Open Interest data is only included when the oi=1 query parameter is added to the request.

Example:

    [
        "2024-03-05T00:00:00+0530",
        26000,
        41505,
        21400,
        33330,
        2950530,
        487485
    ]
**Actual Values:**
- Open: ₹260.00 (26000 ÷ 100)
- High: ₹415.05 (41505 ÷ 100)
- Low: ₹214.00 (21400 ÷ 100)
- Close: ₹333.30 (33330 ÷ 100)
- Volume: 2,950,530 contracts
- Open Interest: 487,485 contracts

Sample Data Analysis

NSE Equity Example (SBIN)

Daily candle data for State Bank of India (Token: 3045):

SBIN Price Movement

Period: May 2-10, 2023
Token: 3045 (SBIN)
Interval: Daily

Date Open High Low Close Volume
May 2 ₹580.00 ₹580.85 ₹573.15 ₹575.30 13.67M
May 3 ₹570.65 ₹575.00 ₹569.00 ₹570.50 9.70M
May 4 ₹570.20 ₹580.80 ₹568.50 ₹580.00 12.53M
May 5 ₹580.20 ₹588.25 ₹575.04 ₹576.50 18.16M
May 8 ₹577.65 ₹587.60 ₹577.35 ₹583.60 12.99M
May 9 ₹585.00 ₹586.45 ₹572.10 ₹573.50 18.96M
May 10 ₹575.00 ₹575.00 ₹563.25 ₹572.20 18.56M

NFO Derivatives Example

Daily candle data with Open Interest for an NFO instrument (Token: 41927):

NFO Options Analysis

Period: March 5-7, 2024
Token: 41927
Interval: Daily
Open Interest: Enabled

Date Open High Low Close Volume OI
Mar 5 ₹260.00 ₹415.05 ₹214.00 ₹333.30 2.95M 487K
Mar 6 ₹289.30 ₹600.00 ₹255.20 ₹407.05 13.95M 1.78M
Mar 7 ₹424.00 ₹448.00 ₹288.10 ₹329.15 26.73M 3.86M

Open Interest Analysis

The increasing Open Interest from 487K to 3.86M contracts indicates growing market participation and position buildup in this derivative instrument.

Key Features

Multiple Timeframes

Support for granular intraday data (1-minute intervals) through long-term analysis (monthly candles), enabling diverse trading and analysis strategies.

Price Precision

All price values are stored as integers (multiplied by 100) to ensure precision and avoid floating-point arithmetic issues in financial calculations.

Open Interest Data

For derivatives (NFO), optional Open Interest data provides insight into market positioning and liquidity trends.

Timezone Information

All timestamps include timezone offset information (+0530 for IST), ensuring accurate time-based analysis across different regions.

Error Handling

The API follows standard HTTP status codes and returns structured error responses:

{
  "status": "error",
  "message": "Invalid date range",
  "code": "INVALID_DATE_RANGE"
}

Common Issues

  • 400 Bad Request: Invalid parameters (exchange, token, interval, or date format)
  • 401 Unauthorized: Invalid or expired token
  • 403 Forbidden: Insufficient permissions
  • 404 Not Found: Invalid instrument token or exchange
  • 422 Unprocessable Entity: Date range exceeds maximum allowed period
  • 429 Too Many Requests: Rate limit exceeded
  • 500 Internal Server Error: Server-side processing error

Rate Limits

Tier Requests per minute Burst limit
Basic 60 10
Premium 300 50
Enterprise 1000 100

Integration Notes

Best Practices

  • Always divide price values (Open, High, Low, Close) by 100 to get actual prices
  • Use appropriate intervals based on your analysis needs (smaller intervals generate more data)
  • Request reasonable date ranges to avoid timeout or size limit issues
  • Cache historical data locally to minimize API calls for backtesting
  • Use the oi=1 parameter only when Open Interest data is needed (NFO only)
  • Implement proper error handling for missing data or date range issues
  • Validate date formats match yyyy-MM-ddTHH:mm:ss specification

Data Availability

Historical data availability varies by instrument and exchange. Some instruments may have limited historical data, especially for newly listed securities or derivatives contracts.

Date Range Limits

There may be maximum date range limits depending on the interval selected. For very large datasets, consider breaking requests into smaller time periods.