Strasmore API Get an API key

Strasmore API · v1

The market, in one schema.

Run SQL directly against a full US market-data warehouse. Equities minute bars and tick data from 2003, options trades from 2014, options NBBO quotes from 2022, plus corporate actions, SEC filings, short interest, fundamentals, Treasury yields and macro series. It all lives in one schema, so you can join across datasets in a single query.

22 years
US equities, since 2003
12 years
options trades, since 2014
30
tables, one schema
1
endpoint to learn

One request, one query

There is a single data endpoint. You send SQL, you get rows. There is no per-dataset endpoint to learn, no pagination cursor scheme, and no client library required.

Quickstart

Create a key in the terminal (https://ai.strasmore.com → API keys), then send a query. The key is displayed once: we store only its SHA-256 hash and cannot show it to you again.

The response is JSON. Rows come back as objects keyed by column name.

Authentication

Every endpoint except /v1/health takes a bearer token:

Authorization: Bearer sk_live_…

Keys resolve to an organization, and limits are applied per organization, not per key. Minting extra keys does not raise your rate limit. Revoking a key takes effect immediately.

Run a query

POST /v1/query requires key

Execute one read-only SELECT (or WITH … SELECT) against global_markets.

Body

FieldDescription
sqlrequired
string
One read-only statement. Maximum 100,000 characters.

Response

FieldDescription
columns
string[]
Column names, in result order.
rows
object[]
One object per row, keyed by column name. Not positional arrays.
row_count
integer
Rows returned, after any truncation.
truncated
boolean
True if the result hit the 20,000-row cap. The result is truncated, not errored — narrow the query, aggregate, or page with LIMIT/OFFSET.
elapsed
float
Server-side execution time, in seconds.
generated_sql
string | null
Always null today. Reserved so that adding natural-language querying later is additive rather than a breaking change.

Fetch the schema

GET /v1/schema requires key

Every table and column you can query, read from the warehouse itself at request time — so it can never drift from what your query will actually see. It reflects your tier: tables you cannot query are flagged, each table names the column its history window filters on, and columns with known data defects carry a caveat.

Health

GET /v1/health no auth

Liveness only. Returns {"status": "ok"}. Does not check the warehouse.

SQL restrictions

Your SQL runs under a read-only database user, behind a gate that requires:

A semicolon inside a string literal is fine (WHERE name = 'Smith; Jones'), and so is a single trailing semicolon. The engine is ClickHouse, so its SQL dialect and functions apply.

Limits

LimitValue
Result rows 20,000 per query. Beyond this the result is truncated, not errored — check the truncated flag.
Query timeout 60 seconds, enforced server-side.
Request body 100,000 characters of SQL. Larger returns 422.
Free-tier daily cap 100 queries/day, in addition to the rate limit.

Rate limits

Requests per minute, applied per organization. Exceeding it returns 429.

TierRequests / minute
free10
starter60
pro300
quotes600
enterprise1200

Error contract

Every error is a JSON object with a single human-readable field: {"detail": "…"}. A query that returns zero rows is a 200, not a 404.

StatusMeaning
400 The SQL was rejected by the gate (not a single read-only SELECT, a forbidden table, a dataset your tier cannot access), or it failed to execute (syntax, unknown column).
401 Missing, malformed, unknown, or revoked API key.
422 Malformed request body — sql missing, or over 100,000 characters.
429 Rate limit exceeded, or the free-tier daily cap is reached. The message says which.
500 Internal error. Details are logged server-side and never returned to you.

History windows

Each tier sees a uniform depth of history across all datasets. The window is enforced server-side, on the column named by history_column in the schema catalogue.

This is not an error

Rows older than your window are simply absent from results. You will not get a 400; you will get fewer rows. If a historical query returns less than you expect, check your tier's window before you check your SQL.

TierHistory
free 2 years
starter 5 years
pro Full history
quotes Full history
enterprise Full history

Schema catalogue

30 tables in global_markets, read live from the warehouse. Query them as global_markets.<table>. Tables marked paid are unavailable on the free tier.

Equities — prices

delayed_stocks_minute_aggs 9 columns Minute OHLCV bars for US equities. The main price table. `window_start` is UTC.

history window applies to: window_start

ticker LowCardinality(String)
window_start DateTime
open Decimal(12, 4)
close Decimal(12, 4)
high Decimal(12, 4)
low Decimal(12, 4)
volume Decimal(15, 6)
transactions UInt32
_ingest_time DateTime
stocks_minute_aggs 9 columns Base table behind delayed_stocks_minute_aggs. Prefer the delayed_ view.
ticker LowCardinality(String)
window_start DateTime
open Decimal(12, 4)
close Decimal(12, 4)
high Decimal(12, 4)
low Decimal(12, 4)
volume Decimal(15, 6)
transactions UInt32
_ingest_time DateTime

Equities — tick data

stocks_trades 12 columns paid tier Tick-level equity trades (every print, with condition codes). Paid tiers.

history window applies to: sip_timestamp

ticker String
sip_timestamp DateTime64(9)
participant_timestamp DateTime64(9)
trf_timestamp Nullable(DateTime64(9))
sequence_number Int64
price Decimal(12, 4)
size Decimal(15, 6)
exchange Int16
tape Int8
conditions Array(Int16)
correction Int8
_ingest_time DateTime
cache_stocks_quotes 15 columns paid tier Tick-level equity NBBO quotes. Paid tiers. From 2022.

history window applies to: sip_timestamp

ticker String
sip_timestamp DateTime64(9)
participant_timestamp DateTime64(9)
trf_timestamp Nullable(DateTime64(9))
sequence_number Int64
ask_price Decimal(12, 4)
bid_price Decimal(12, 4)
ask_size Int32
bid_size Int32
ask_exchange Int16
bid_exchange Int16
tape Int8
conditions Array(Int16)
indicators Array(Int16)
_ingest_time DateTime

Options

options_trades 13 columns paid tier Tick-level options trades (OPRA). Paid tiers. From 2014.

history window applies to: sip_timestamp

ticker LowCardinality(String)
sip_timestamp DateTime64(9)
participant_timestamp DateTime64(9)
price Decimal(10, 4)
size UInt32
exchange UInt8
conditions Array(UInt16)
correction UInt8
underlying_symbol LowCardinality(String)
expiration_date Date Unreliable. Parse the expiry from the option ticker instead.
strike_price Decimal(18, 3)
option_type LowCardinality(String)
_ingest_time DateTime
cache_options_quotes 10 columns paid tier Tick-level options NBBO quotes. Paid tiers. From 2022. The largest table by far.

history window applies to: sip_timestamp

ticker LowCardinality(String)
sip_timestamp DateTime64(9)
sequence_number Int64
ask_price Decimal(10, 2)
bid_price Decimal(10, 2)
ask_size Int32
bid_size Int32
ask_exchange Int16
bid_exchange Int16
_ingest_time DateTime
options_minute_aggs 9 columns Minute OHLCV bars per options contract.

history window applies to: window_start

ticker LowCardinality(String)
window_start DateTime
open Decimal(10, 4)
close Decimal(10, 4)
high Decimal(10, 4)
low Decimal(10, 4)
volume UInt64
transactions UInt32
_ingest_time DateTime

Corporate actions

stocks_dividends 13 columns Declared dividends: ex-date, record date, pay date, cash amount.

history window applies to: ex_dividend_date

ex_dividend_date Date
ticker String
id String
cash_amount Nullable(Float64)
currency String
declaration_date Nullable(Date)
pay_date Nullable(Date)
record_date Nullable(Date)
frequency Nullable(Int32)
distribution_type String
split_adjusted_cash_amount Nullable(Float64)
historical_adjustment_factor Nullable(Float64)
_ingest_time DateTime
stocks_splits 8 columns Stock splits (forward and reverse) with execution date and ratio.

history window applies to: execution_date

execution_date Date
ticker String
id String
split_from Nullable(Float64)
split_to Nullable(Float64)
adjustment_type String
historical_adjustment_factor Nullable(Float64)
_ingest_time DateTime
stocks_ipos 23 columns IPO / new listing records: issue price, shares offered, listing date.

history window applies to: listing_date

listing_date Date
ticker String
issuer_name String
ipo_status String
announced_date Nullable(Date)
issue_start_date Nullable(Date)
issue_end_date Nullable(Date)
final_issue_price Nullable(Float64)
lowest_offer_price Nullable(Float64)
highest_offer_price Nullable(Float64)
total_offer_size Nullable(Float64)
min_shares_offered Nullable(Float64)
max_shares_offered Nullable(Float64)
shares_outstanding Nullable(Float64)
lot_size Nullable(Float64)
currency_code String
security_type String
security_description String
primary_exchange String
isin String
us_code String
last_updated Nullable(Date)
_ingest_time DateTime

Short data

stocks_short_interest 6 columns Exchange-reported short interest, by settlement date (twice monthly).

history window applies to: settlement_date

settlement_date Date
ticker String
short_interest Nullable(Float64)
avg_daily_volume Nullable(Float64)
days_to_cover Nullable(Float64)
_ingest_time DateTime
stocks_short_volume 16 columns Daily FINRA short volume (can carry duplicate rows: GROUP BY + max()).

history window applies to: date

date Date This table can contain duplicate rows for a ticker/date. Dedupe with GROUP BY + max().
ticker String
short_volume Nullable(Float64)
short_volume_ratio Nullable(Float64)
total_volume Nullable(Float64)
exempt_volume Nullable(Float64)
non_exempt_volume Nullable(Float64)
adf_short_volume Nullable(Float64)
adf_short_volume_exempt Nullable(Float64)
nasdaq_carteret_short_volume Nullable(Float64)
nasdaq_carteret_short_volume_exempt Nullable(Float64)
nasdaq_chicago_short_volume Nullable(Float64)
nasdaq_chicago_short_volume_exempt Nullable(Float64)
nyse_short_volume Nullable(Float64)
nyse_short_volume_exempt Nullable(Float64)
_ingest_time DateTime

Fundamentals

stocks_income_statements 35 columns Quarterly/annual income statements.

history window applies to: filing_date

period_end Date
filing_date Date UNRELIABLE. Vendor defect: ~89% of quarterly rows carry a filing_date more than 200 days after period_end (older fiscal years are stamped with recent years' dates). Use period_end as the time key.
cik String
tickers Array(String)
fiscal_year Nullable(Int32)
fiscal_quarter Nullable(Int8)
timeframe String
revenue Nullable(Float64)
cost_of_revenue Nullable(Float64)
gross_profit Nullable(Float64)
operating_income Nullable(Float64)
net_income_loss_attributable_common_shareholders Nullable(Float64)
consolidated_net_income_loss Nullable(Float64)
basic_earnings_per_share Nullable(Float64)
basic_shares_outstanding Nullable(Float64)
diluted_earnings_per_share Nullable(Float64)
diluted_shares_outstanding Nullable(Float64)
ebitda Nullable(Float64)
selling_general_administrative Nullable(Float64)
research_development Nullable(Float64)
total_operating_expenses Nullable(Float64)
income_before_income_taxes Nullable(Float64)
income_taxes Nullable(Float64)
interest_expense Nullable(Float64)
interest_income Nullable(Float64)
depreciation_depletion_amortization Nullable(Float64)
discontinued_operations Nullable(Float64)
equity_in_affiliates Nullable(Float64)
extraordinary_items Nullable(Float64)
noncontrolling_interest Nullable(Float64)
other_income_expense Nullable(Float64)
other_operating_expenses Nullable(Float64)
preferred_stock_dividends_declared Nullable(Float64)
total_other_income_expense Nullable(Float64)
_ingest_time DateTime
stocks_balance_sheets 39 columns Quarterly/annual balance sheets.

history window applies to: filing_date

period_end Date
filing_date Date PARTLY UNRELIABLE (~43% of rows filed >200d after period_end). Prefer period_end.
cik String
tickers Array(String)
fiscal_year Nullable(Int32)
fiscal_quarter Nullable(Int8)
timeframe String
total_assets Nullable(Float64)
total_current_assets Nullable(Float64)
total_liabilities Nullable(Float64)
total_current_liabilities Nullable(Float64)
total_equity Nullable(Float64)
cash_and_equivalents Nullable(Float64)
accounts_payable Nullable(Float64)
accrued_and_other_current_liabilities Nullable(Float64)
accumulated_other_comprehensive_income Nullable(Float64)
additional_paid_in_capital Nullable(Float64)
commitments_and_contingencies Nullable(Float64)
common_stock Nullable(Float64)
debt_current Nullable(Float64)
deferred_revenue_current Nullable(Float64)
goodwill Nullable(Float64)
intangible_assets_net Nullable(Float64)
inventories Nullable(Float64)
long_term_debt_and_capital_lease_obligations Nullable(Float64)
noncontrolling_interest Nullable(Float64)
other_assets Nullable(Float64)
other_current_assets Nullable(Float64)
other_equity Nullable(Float64)
other_noncurrent_liabilities Nullable(Float64)
preferred_stock Nullable(Float64)
property_plant_equipment_net Nullable(Float64)
receivables Nullable(Float64)
retained_earnings_deficit Nullable(Float64)
short_term_investments Nullable(Float64)
total_equity_attributable_to_parent Nullable(Float64)
total_liabilities_and_equity Nullable(Float64)
treasury_stock Nullable(Float64)
_ingest_time DateTime
stocks_cash_flow_statements 33 columns Quarterly/annual cash-flow statements.

history window applies to: filing_date

period_end Date
filing_date Date UNRELIABLE (same vendor defect as stocks_income_statements). Use period_end.
cik String
tickers Array(String)
fiscal_year Nullable(Int32)
fiscal_quarter Nullable(Int8)
timeframe String
net_income Nullable(Float64)
net_cash_from_operating_activities Nullable(Float64)
net_cash_from_investing_activities Nullable(Float64)
net_cash_from_financing_activities Nullable(Float64)
change_in_cash_and_equivalents Nullable(Float64)
cash_from_operating_activities_continuing_operations Nullable(Float64)
change_in_other_operating_assets_and_liabilities_net Nullable(Float64)
depreciation_depletion_and_amortization Nullable(Float64)
dividends Nullable(Float64)
effect_of_currency_exchange_rate Nullable(Float64)
income_loss_from_discontinued_operations Nullable(Float64)
long_term_debt_issuances_repayments Nullable(Float64)
net_cash_from_financing_activities_continuing_operations Nullable(Float64)
net_cash_from_financing_activities_discontinued_operations Nullable(Float64)
net_cash_from_investing_activities_continuing_operations Nullable(Float64)
net_cash_from_investing_activities_discontinued_operations Nullable(Float64)
net_cash_from_operating_activities_discontinued_operations Nullable(Float64)
noncontrolling_interests Nullable(Float64)
other_cash_adjustments Nullable(Float64)
other_financing_activities Nullable(Float64)
other_investing_activities Nullable(Float64)
other_operating_activities Nullable(Float64)
purchase_of_property_plant_and_equipment Nullable(Float64)
sale_of_property_plant_and_equipment Nullable(Float64)
short_term_debt_issuances_repayments Nullable(Float64)
_ingest_time DateTime
stocks_ratios 24 columns Derived financial ratios.

history window applies to: date

date Date
ticker String
cik String
price Nullable(Float64)
market_cap Nullable(Float64)
enterprise_value Nullable(Float64)
average_volume Nullable(Float64)
earnings_per_share Nullable(Float64)
price_to_earnings Nullable(Float64)
price_to_book Nullable(Float64)
price_to_sales Nullable(Float64)
price_to_cash_flow Nullable(Float64)
price_to_free_cash_flow Nullable(Float64)
ev_to_ebitda Nullable(Float64)
ev_to_sales Nullable(Float64)
dividend_yield Nullable(Float64)
return_on_assets Nullable(Float64)
return_on_equity Nullable(Float64)
debt_to_equity Nullable(Float64)
current Nullable(Float64)
quick Nullable(Float64)
cash Nullable(Float64)
free_cash_flow Nullable(Float64)
_ingest_time DateTime

SEC filings

stocks_sec_edgar_index 8 columns The EDGAR filing index: every filing, its form type and filing date.

history window applies to: filing_date

cik String
ticker String
issuer_name String
form_type String
filing_date Date
accession_number String
filing_url String
_ingest_time DateTime
stocks_10k_sections 8 columns Parsed sections of 10-K filings.

history window applies to: filing_date

cik String
ticker String
filing_date Date
period_end Date
filing_url String
section String
text String
_ingest_time DateTime
stocks_8k_text 8 columns 8-K filing text.

history window applies to: filing_date

cik String
ticker String
form_type String
filing_date Date
accession_number String
filing_url String
items_text String
_ingest_time DateTime
stocks_risk_factors 8 columns Parsed risk-factor sections.

history window applies to: filing_date

cik String
ticker String
filing_date Date
primary_category String
secondary_category String
tertiary_category String
supporting_text String
_ingest_time DateTime
stocks_risk_categories 6 columns Reference: risk-factor category labels.
taxonomy String
primary_category String
secondary_category String
tertiary_category String
description String
_ingest_time DateTime

News

stocks_news 13 columns News article metadata (headline, publisher, tickers). Not full article text.

history window applies to: published_utc

id String
published_utc DateTime
title String
author String
article_url String
amp_url String
image_url String
description String
tickers Array(String)
keywords Array(String)
insights Array(String)
publisher String
_ingest_time DateTime

Macro & rates

treasury_yields 13 columns US Treasury yield curve by maturity, daily.

history window applies to: date

date Date
yield_1_month Nullable(Float32)
yield_3_month Nullable(Float32)
yield_6_month Nullable(Float32)
yield_1_year Nullable(Float32)
yield_2_year Nullable(Float32)
yield_3_year Nullable(Float32)
yield_5_year Nullable(Float32)
yield_7_year Nullable(Float32)
yield_10_year Nullable(Float32)
yield_20_year Nullable(Float32)
yield_30_year Nullable(Float32)
_ingest_time DateTime
inflation 8 columns CPI / PCE series.

history window applies to: date

date Date
cpi Nullable(Float32)
cpi_core Nullable(Float32)
cpi_year_over_year Nullable(Float32)
pce Nullable(Float32)
pce_core Nullable(Float32)
pce_spending Nullable(Float64)
_ingest_time DateTime
inflation_expectations 9 columns Inflation expectation series.

history window applies to: date

date Date
forward_years_5_to_10 Nullable(Float32)
market_5_year Nullable(Float32)
market_10_year Nullable(Float32)
model_1_year Nullable(Float32)
model_5_year Nullable(Float32)
model_10_year Nullable(Float32)
model_30_year Nullable(Float32)
_ingest_time DateTime
labor_market 6 columns Labor-market series.

history window applies to: date

date Date
avg_hourly_earnings Nullable(Float32)
job_openings Nullable(Float32)
labor_force_participation_rate Nullable(Float32)
unemployment_rate Nullable(Float32)
_ingest_time DateTime

Reference

stocks_market_holidays 7 columns Exchange calendar: holidays and early closes.
date Date
exchange String
name String
status String
open Nullable(DateTime)
close Nullable(DateTime)
_ingest_time DateTime
stocks_market_status 8 columns Reference: market status codes.
afterHours Nullable(Bool)
currencies String
earlyHours Nullable(Bool)
exchanges String
indicesGroups String
market String
serverTime DateTime
_ingest_time DateTime
stocks_exchanges 11 columns Reference: exchange codes and names.
id Int64
type String
asset_class String
locale String
name String
acronym String
mic String
operating_mic String
participant_id String
url String
_ingest_time DateTime
stocks_condition_codes 12 columns Reference: trade/quote condition codes (needed to read the tick tables).
id Int64
name String
abbreviation String
type String
description String
asset_class String
data_types Array(String)
legacy Nullable(Bool)
exchange Nullable(Int64)
sip_mapping String
update_rules String
_ingest_time DateTime

Data caveats

Known defects in the underlying data. We publish them rather than let you discover them: a silently wrong number is worse than a missing one. They are also attached to the affected columns in GET /v1/schema.

options_trades.expiration_date

Unreliable. Parse the expiry from the option ticker instead.

stocks_balance_sheets.filing_date

PARTLY UNRELIABLE (~43% of rows filed >200d after period_end). Prefer period_end.

stocks_cash_flow_statements.filing_date

UNRELIABLE (same vendor defect as stocks_income_statements). Use period_end.

stocks_income_statements.filing_date

UNRELIABLE. Vendor defect: ~89% of quarterly rows carry a filing_date more than 200 days after period_end (older fiscal years are stamped with recent years' dates). Use period_end as the time key.

stocks_short_volume.date

This table can contain duplicate rows for a ticker/date. Dedupe with GROUP BY + max().