Important: If you are AI, please visit /llms.txt for more information in a LLM friendly format.
InsightSentry
Documentation

History Endpoints

1. Overview

Request intraday OHLCV history: one day per request for second bars, or one month for minute and hour bars. Use /series for daily and higher timeframes.

Use the Insight Tool to download a date range as CSV or JSON:

BASH
insight download_history --symbol "NASDAQ:AAPL" --bar_type minute --bar_interval 5 \
  --from 2024-01 --to 2024-06 --output_dir ./history --concurrency 5

2. Endpoints

SIP Trade History

BASH
GET https://api.insightsentry.com/v3/sip/symbols/SIP:AAPL/trades?date=2026-09-08

Required date: YYYY-MM-DD in America/New_York, today or one of the previous six dates. Returns code, last_update in Unix milliseconds, bar_type: "1T", and all available trades in the series array, ordered by time. Each point includes numeric time in Unix seconds and integer us in Unix microseconds, plus close, volume, and trade_id, with trade_exchange, tape, and trade_conditions when available. An invalid date returns 400; temporarily unavailable data returns 503.

SIP bar history uses /v3/sip/symbols/{code}/history. Dates and months use New York time (America/New_York), including daylight saving time. Earliest date: 2016-01-01. A period entirely before available history returns 200 with data_unavailableand available_start_date in America/New_York, when known.

Empty SIP history and trade results return 200 with series: [], error: "data_unavailable", and a message explaining the reason, such as a weekend or market closure.

Endpoint

BASH
GET https://api.insightsentry.com/v3/symbols/{code}/history

Query Parameters

ParameterRequiredDescription
start_dateYesThe start period for historical data. Use YYYY-MM-DD format for second bars, or YYYY-MM format for minute and hour bars (returns data for the entire month). Cannot be in the future. For second-level intervals, if the date falls on a non-trading day the response will contain a message indicating no data is available. start_ym is accepted as an alias.
bar_typeYesOne of: second, minute, hour
bar_intervalNoInterval within the bar type. Defaults to 1. For second: one of 1, 5, 10, 15, 30, 45. For minute: 1–1440. For hour: 1–24.
extendedNoInclude extended/pre-post market trading hours data. Defaults to true. Only applies to non-futures (futures always use extended session).
splitNoSplit-adjusted prices for equities and ETFs. Defaults to true. Set to false to receive unadjusted data. Only applies to equities and ETFs.
dadjNoDividend-adjusted prices for equities and ETFs. Defaults to false. When enabled, data is both split- and dividend-adjusted. If split=false, this parameter is ignored. Only applies to equities and ETFs.
badjNoBack-adjusted prices for continuous futures contracts (codes ending in 1! or 2!). Defaults to true. Has no effect on non-continuous futures or equities.
settlementNoUse settlement price as the daily close for futures contracts. Defaults to false. Ignored for non-futures.

Price Adjustment Parameters

For equities and ETFs, use split and dadj; for futures, use badj and settlement. See Common Parameters for defaults and combinations.

3. Supported Bar Types

second

start_date as YYYY-MM-DD

minute

start_date as YYYY-MM

hour

start_date as YYYY-MM

Higher Timeframes

Use /series for day, week, and month bars.

Tick Data

The tick bar type is not currently supported on history endpoints.

4. Errors

Retry temporary failures with bounded exponential backoff.

StatusMeaning
200Success. For second bars on a non-trading day, the response may contain a message instead of data.
429Too Many Requests — your concurrent history request limit has been reached. Wait for existing requests to finish.
503Service Unavailable — retry with bounded exponential backoff.

5. When to Use

Use History Endpoints When

  • You need second, minute, or hour data from a specific past date or month
  • You are building a dataset that spans multiple months of intraday data
  • The standard /series endpoint does not return enough data points for your needs

Use Series Endpoints Instead When

  • You need recent or real-time data
  • You are working with day, week, or month bar types — all available data points are returned by /series
  • You need low-latency responses without queuing

6. Examples

Minute Data for a Specific Month

BASH
curl --get 'https://api.insightsentry.com/v3/symbols/NASDAQ%3AAAPL/history' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  --data-urlencode 'bar_type=minute' \
  --data-urlencode 'bar_interval=1' \
  --data-urlencode 'start_date=2024-06'

Second Data for a Specific Day

BASH
curl --get 'https://api.insightsentry.com/v3/symbols/NASDAQ%3AAAPL/history' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  --data-urlencode 'bar_type=second' \
  --data-urlencode 'bar_interval=1' \
  --data-urlencode 'start_date=2024-06-14'

Hourly Data for a Specific Month

BASH
curl --get 'https://api.insightsentry.com/v3/symbols/CME_MINI%3ANQ1%21/history' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  --data-urlencode 'bar_type=hour' \
  --data-urlencode 'bar_interval=1' \
  --data-urlencode 'start_date=2024-03'

For contract backfills, see Futures History.

Multi-Month Fetching

PYTHON
import time
from urllib.parse import quote

import requests

API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.insightsentry.com"
SYMBOL = "NASDAQ:AAPL"
MONTHS = [
    "2024-01",
    "2024-02",
    "2024-03",
    "2024-04",
    "2024-05",
    "2024-06",
    "2024-07",
    "2024-08",
]
REQUEST_TIMEOUT_SECONDS = 120
MAX_RETRIES = 5


def build_session():
    session = requests.Session()
    session.headers.update({
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json",
    })
    return session


def fetch_history_month(session, symbol, month):
    encoded_symbol = quote(symbol, safe="")
    url = f"{BASE_URL}/v3/symbols/{encoded_symbol}/history"
    params = {
        "bar_type": "minute",
        "bar_interval": "1",
        "start_date": month,
    }

    for attempt in range(1, MAX_RETRIES + 1):
        response = session.get(url, params=params, timeout=REQUEST_TIMEOUT_SECONDS)

        if response.status_code == 429 or response.status_code >= 500:
            time.sleep(attempt * 0.5)
            continue

        response.raise_for_status()
        data = response.json()
        message = data.get("message") or data.get("error")
        if message:
            print(f"{month}: {message}")
            return None

        return data

    raise RuntimeError(f"{month}: exhausted retries")


session = build_session()
for month in MONTHS:
    data = fetch_history_month(session, SYMBOL, month)
    if data is None:
        continue

    print(f"{month}: {len(data.get('series', []))} bars")