History Request

?action=history is the workhorse of the Kibot API. It returns tick, intraday, daily, weekly, monthly, or yearly bars for one symbol per call as comma-separated text. Every parameter, interval granularity, date range, regular-session filtering, adjustment mode, instrument type, browser-attach behaviour, and timezone, sits on the URL; there is no body, no JSON envelope, and no pagination. This article documents every accepted parameter, the response shape, and the practical patterns for incremental updates and tick downloads.

Request URL

http://api.kibot.com/?action=history
 &symbol=[symbol]
 &interval=[interval]
 &period=[period]
 &startdate=[startdate]
 &enddate=[enddate]
 &regularsession=[regularsession]
 &unadjusted=[unadjusted]
 &splitadjusted=[splitadjusted]
 &type=[type]
 &attach=[attach]
 &timezone=[timezone]

action, symbol, and interval are required; everything else is optional. The URL is wrapped above for readability, actual requests are flat single-line query strings.

Response shape

The body is comma-separated values, one bar per line, no header row. The default field order matches Kibot's standard CSV files (see Data format reference):

08/31/2011,09:30,12.52,12.68,12.50,12.66,1004620
08/31/2011,09:35,12.65,12.65,12.58,12.63,696432

The columns are Date,Time,Open,High,Low,Close,Volume for intraday bars and Date,Open,High,Low,Close,Volume for daily/weekly/monthly/yearly. Tick variants add bid/ask columns; aggregate bid/ask intervals carry separate bid and ask OHLC blocks. Field-by-field layouts for every interval type live in Data format reference and the tick data article.

Two daily-only extras worth flagging here: &openinterest=1 adds an open-interest column to daily futures responses (it has no effect on intraday or non-futures requests, per support), and a Content-Disposition filename= header is set whenever &attach=1 is used so download managers see the natural per-symbol filename.

Parameters

action (required)

Always history for this endpoint.

symbol (required)

Any ticker available on Kibot's servers that the authenticated account is entitled to download. Authorization is per-symbol: a Premium account can only fetch symbols inside one of its purchased packages, plus the small set of always-free symbols. For futures, the symbol follows Kibot's simplified base format (ES, CL, GC) and is paired with &type=futures, see Futures symbols for the full mapping and Continuous futures for how the # suffix selects continuous series.

interval (required)

The bar granularity. Accepted values fall into four groups.

Tick intervals. tick, tickbidask, tick1sec, tick5sec, tick10sec, tick15sec, tick30sec. tick excludes bid and ask prints; the tickNsec family aggregates tick prints into 1-, 5-, 10-, 15-, or 30-second bars. Millisecond timestamps are available with tickms and tickbidaskms (still flagged experimental in the docs).

Aggregate bid/ask intervals. tickbidask1, tickbidask5, tickbidask15, tickbidask30 for 1-, 5-, 15-, and 30-minute bid/ask aggregations. The output format is documented under Aggregate bid/ask format.

Intraday intervals. Any integer 1–60 (minutes), or a multiple of 60 above that, 60, 120, 180, 240, etc. The hour-multiple values are how clients ask for 2-hour, 3-hour, or 4-hour bars; the server resamples from the underlying minute data on the fly.

Calendar intervals. Daily, Weekly, Monthly, Yearly. Guest accounts are restricted to Daily only.

period (optional)

An integer number of calendar days to look back from the current date (or from enddate if specified). Counting is by calendar day, not trading day, so period=10 over a weekend returns roughly 7 trading days of bars. If the requested period exceeds the on-server history for the symbol, the server returns whatever it has without erroring.

period and the startdate/enddate pair are alternatives. If period is omitted, the difference between startdate and enddate defines the window.

startdate (optional)

Inclusive lower bound, formatted MM/DD/YYYY. Required if period is not provided.

enddate (optional)

Inclusive upper bound, formatted MM/DD/YYYY. Defaults to the previous business day if omitted.

For intraday and tick requests, the newest date actually served reflects the account's update plan (see Data updates): data ends at the plan's current cutoff, so requesting an enddate beyond it simply returns bars through that cutoff. Daily and end-of-day intervals are exempt and are always served fully current.

regularsession (optional)

1 to include regular session bars only (9:30 AM–4:00 PM ET on full days, 9:30 AM–1:00 PM on early-close days). 0 or omitted includes pre-market (4:00–9:30 AM ET), regular, and after-hours (4:00–8:00 PM ET on full days, 4:00–5:00 PM on early-close days). Only meaningful for intraday and tick requests; ignored for daily and longer intervals. Early-close handling matches Kibot's published holiday calendar.

unadjusted (optional)

1 to return unadjusted prices, exactly as they printed at the exchange, with no back-adjustment for splits or dividends. Defaults to 0 (fully adjusted). Applies only to US stocks and ETFs; futures and forex are always returned as printed. The trade-offs between adjusted and unadjusted are explored in Adjusted vs unadjusted data.

splitadjusted (optional)

1 to return data adjusted for splits only, with dividends ignored. This matches the convention used by Yahoo Finance and Google Finance charts. If the symbol has never split, the response is identical to the unadjusted feed. Applies only to US stocks and ETFs.

type (optional)

The instrument class. Accepts stocks, etfs, forex, or futures. Defaults to stocks if omitted, so any forex or futures call must specify the type explicitly. Mismatches produce 404 Symbol Not Found.

attach (optional)

1 triggers a "save file" dialog in browsers and download managers by setting Content-Disposition: attachment on the response. 0 or omitted streams the data inline. Useful for one-off browser-driven downloads; programmatic clients usually leave this off.

timezone (optional)

Either UTC or a numeric offset between -24 and 24. Defaults to ET (New York) if omitted. Setting &timezone=UTC is the simplest way to skip DST bookkeeping in the caller, see Timezone conversion for the broader discussion of how Kibot anchors all data to ET and what the numeric offsets mean for crossover bars.

Worked examples

Six concrete URLs cover most real-world patterns.

Last 5 days of 3-minute bars, regular session only

http://api.kibot.com/?action=history&symbol=MSFT&interval=3&period=5&regularsession=1

Response:

08/31/2011,09:30,26.29,26.39,26.29,26.36,878715
08/31/2011,09:33,26.3678,26.4,26.3,26.34,588017
08/31/2011,09:36,26.3407,26.36,26.27,26.27,601274

Weekly bars since January 1, 2005

http://api.kibot.com/?action=history&symbol=WMT&interval=weekly&startdate=1/1/2005

Response:

1/3/2005,53.30,54.05,53.64,53.99,58605900
1/10/2005,53.59,54.10,53.75,53.99,40737600
1/18/2005,53.53,54.29,53.48,53.01,34229500

Weekly bars omit the time column, the Date is the bar's start date.

60-minute bars across a specific month

http://api.kibot.com/?action=history&symbol=MSFT&interval=60&startdate=8/1/2011&enddate=8/31/2011

The startdate/enddate pair makes the window explicit; useful for backfilling a known gap.

Tick data with bid/ask for the last 10 days

http://api.kibot.com/?action=history&symbol=MSFT&interval=tickbidask&period=10

Tick responses can be very large; the server compresses them with gzip when the client sends Accept-Encoding: gzip,deflate (see Server responses). A 10-day MSFT tickbidask download can run into hundreds of MB uncompressed.

Futures tick data (note the &type=futures)

http://api.kibot.com/?action=history&symbol=BO&interval=tickbidask&period=10&type=futures

BO is Kibot's simplified symbol for soybean oil; without &type=futures the server would look for a US stock named BO and return 404 Symbol Not Found.

Unadjusted daily data

http://api.kibot.com/?action=history&symbol=MSFT&interval=1&period=10&unadjusted=1

Despite interval=1 (one minute) in the docs example, this pattern is most useful with daily intervals when the consumer needs to cross-check splits or compute custom adjustments.

Patterns

Incremental updates

Two API calls together implement an idiomatic "fetch only what's new" loop for a stored symbol file. First, find the last date already on disk. Second, call ?action=adjustments&symbol=SYM&startdate=<lastdate> (Adjustments request); if the server returns 404 Not Found no splits or dividends have happened since, and a normal history request from lastdate forward gives you the missing bars. If the adjustments call returns rows, the entire file needs to be re-downloaded because the historical bars before lastdate have been retroactively re-adjusted. This pattern is the one Kibot Agent uses internally and is documented at Data updates.

Saving wire bytes on tick downloads

Tick responses dwarf intraday responses by one to two orders of magnitude. Always advertise Accept-Encoding: gzip,deflate (Kibot returns gzip by default, see Server responses) and decompress the stream as it arrives rather than buffering the whole response. The official .NET sample in API client examples sets AutomaticDecompression on HttpWebRequest; equivalents exist in every HTTP library (requests does it transparently when given stream=True, reqwest exposes gzip(true) on the client builder, etc.).

Authorization checks

A 402 Unauthorized response means the account exists and is logged in, but the requested symbol is not part of any package the account has purchased. The fix is one of: buy the package, request a free trial slot from Kibot, or use a different symbol. The full HTTP status table lives in Server responses.

Avoid daily login storms

The biggest performance trap when scripting against history is calling ?action=login before every symbol. Login is roughly the same cost as a small data request, so per-symbol logins double wall-clock time on a long batch. The recommended pattern is one login at startup, catch 401 Not Logged In to detect session expiry, re-login on demand. Details in API authentication.

Key Takeaways

  • ?action=history returns CSV bars; the URL carries every parameter, the body carries only data.
  • interval covers tick, aggregate bid/ask (1/5/15/30 min), any minute count up to 60 plus hour-multiples, and the four calendar intervals (daily/weekly/monthly/yearly).
  • &type= must be set to forex or futures for those instrument classes, the default is stocks.
  • &unadjusted=1 and &splitadjusted=1 are mutually exclusive flags that select the adjustment mode for US stocks and ETFs; futures/forex are always as-printed.
  • &attach=1 triggers a browser save dialog via Content-Disposition; useful in browsers, ignored in headless clients.
  • &timezone=UTC returns timestamps in UTC instead of the default ET, the cleanest way to avoid DST bookkeeping.
  • For incremental updates, hit ?action=adjustments first to detect retroactive re-adjustment before downloading new bars.