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 option (interval granularity, date range, regular-session filtering, adjustment mode, instrument type, browser-attach behavior, and timezone) sits on the URL; there is no body, no JSON envelope, and no pagination. This article covers every accepted parameter, the response shape, and the patterns for incremental updates and tick downloads.
Request URL
https://api.kibot.com/?action=history
&symbol=[symbol]
&interval=[interval]
&period=[period]
&startdate=[startdate]
&enddate=[enddate]
®ularsession=[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.
A Content-Disposition filename= header is set whenever &attach=1 is used so download managers see the natural per-symbol filename. Daily futures responses carry the standard Date,Open,High,Low,Close,Volume columns. Add &openinterest=1 to a daily futures request (with type=futures) to receive open interest as an extra seventh column, Date,Open,High,Low,Close,Volume,OpenInterest. Without the parameter the response keeps its six columns. The value on each line is the open interest for the previous trading day, and when the start date of the request is itself a trading day, the first row shows 0. Open interest is available for individual contracts that were still trading in April 2010 or later: from the April 2010 contracts for GC and HG, the May 2010 contracts for C, S, CL, NG and SI, and the June 2010 contract for ES. Earlier contracts carry prices only. The same data is available through the Kibot Agent open interest option. Questions can be sent to support.
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. Premium includes 4 years of 1-minute and coarser history for all stocks, ETFs, futures, and forex, plus daily updates; tick and aggregate bid/ask data are separate purchases, authorized per symbol. The free sample symbols (IBM, OIH, IVE, WDC) are also available. For futures, the symbol follows Kibot's simplified base format (ES, CL, GC) and is paired with &type=futures; the bare root symbol returns the continuous series. See Futures symbols for the full mapping and Continuous futures for how that series is spliced at each rollover.
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 experimental).
Aggregate bid/ask intervals. tickbidask1, tickbidask5, tickbidask15, tickbidask30 for 1-, 5-, 15-, and 30-minute bid/ask aggregations. The output format is covered under Aggregate bid/ask format.
Intraday intervals. Any integer 1–60 (minutes), or a multiple of 60 above that (60, 120, 180, 240, and so on). 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 can request Daily data for stocks and ETFs, plus a few free intraday and tick samples.
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 covers 10 calendar days, which is about 7 trading days of bars once weekends are excluded. 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 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, 1: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 the 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 charts. If the symbol has never split, the response is identical to the unadjusted data. Applies only to US stocks and ETFs.
type (optional)
The instrument class. Accepts stocks (also used for ETFs), forex, futures, indexes, or otc. Defaults to stocks if omitted, so any forex, futures, or index call must specify the type explicitly, with one exception: a symbol beginning with $ (Kibot's index prefix, e.g. $VIX, $NIK) is recognized as an index automatically even with &type= omitted. Mismatches produce 404 Symbol Not Found.
openinterest (optional)
1 adds open interest as a seventh column to daily futures data (requires &type=futures and interval=daily). Only the value 1 is recognized. The parameter is ignored for other instrument types and for intraday, weekly and monthly intervals, which keep their usual columns. See Response shape.
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 whole-hour offset from -23 to 23; it does not apply to daily data. Defaults to ET (New York) if omitted. Setting &timezone=UTC is the simplest way to skip DST bookkeeping in your code; 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
Seven example URLs cover most real-world patterns.
Last 5 days of 3-minute bars, regular session only
https://api.kibot.com/?action=history&symbol=MSFT&interval=3&period=5®ularsession=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
https://api.kibot.com/?action=history&symbol=WMT&interval=weekly&startdate=1/1/2005
Response:
01/03/2005,11.7381,11.8539,11.568,11.7819,262088392
01/10/2005,11.7382,11.8539,11.651,11.771,178762629
01/17/2005,11.6946,11.9128,11.5637,11.5659,153707482
Weekly bars omit the time column. The Date is the bar's start date.
60-minute bars across a specific month
https://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
https://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)
https://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.
Daily index data (note the $ symbol and &type=indexes)
https://api.kibot.com/?action=history&symbol=$VIX&interval=daily&period=10&type=indexes
$VIX is Kibot's symbol for the CBOE Volatility Index; the leading $ marks it as an index. &type=indexes is optional here specifically because the $ prefix is enough for the server to route the request, but it is still the explicit way to ask for index data and is required for any future client that resolves the type before it knows the symbol.
Unadjusted daily data
https://api.kibot.com/?action=history&symbol=MSFT&interval=daily&period=10&unadjusted=1
This pattern is most useful when you need 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 405 Data 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 covered 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 only when the request advertises it; 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 to buy the package or use a different symbol. The full HTTP status table is on the Server responses page.
Log in once, not per symbol
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, and re-login on demand. Details in API authentication.
Key Takeaways
?action=historyreturns CSV bars; the URL carries every parameter, the body carries only data.intervalcovers 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 toforex,futures,indexes, orotcfor those instrument classes; the default isstocks. A$-prefixed symbol is auto-detected as an index even with&type=omitted.&unadjusted=1and&splitadjusted=1are mutually exclusive flags that select the adjustment mode for US stocks and ETFs; futures/forex are always as-printed.&attach=1triggers a browser save dialog viaContent-Disposition; useful in browsers, ignored in headless clients.&timezone=UTCreturns timestamps in UTC instead of the default ET, which is the cleanest way to avoid DST bookkeeping.- For incremental updates, hit
?action=adjustmentsfirst to detect retroactive re-adjustment before downloading new bars.
Related
- API overview: High-level API model and v2 feature summary.
- API authentication: Login, logout, status; required before any history call.
- Adjustments request: Splits and dividends endpoint; pair with
historyfor incremental updates. - Server responses: HTTP status codes and gzip negotiation.
- Data format reference: Field-by-field layout for every interval the response can return.
- Adjusted vs unadjusted data: When to set
unadjusted/splitadjustedand what changes. - Timezone conversion: How
&timezone=interacts with Kibot's ET-anchored data. - API client examples: Login-and-fetch reference code in Python, Rust, Go, JS/TS, and .NET.