通用接口
下面这些接口 Starter 和 Advanced 套餐都能用,覆盖美股股票与 ETF 的聚合行情、历史K线与参考数据。逐笔成交/报价、财务数据是 Advanced 专属,见本页下方 Advanced 专属接口;WebSocket 实时推送见 WebSocket 实时推送;期权数据需要单独开通期权套餐,见期权数据一节;指数用跟踪它的 ETF 合成,见指数代理;外汇与期货暂不提供。
/v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from}/{to}指定时间粒度和区间的历史K线(聚合行情)。需要几年的分钟线、不想自己翻页拼接的话,可以直接下载整理好的 CSV,例如 AAPL、TSLA、SPY。
curl "https://marilux.dev/v2/aggs/ticker/AAPL/range/1/day/2024-01-01/2024-01-05?adjusted=true" \ -H "Authorization: Bearer mh_live_your_key"
{
"ticker": "AAPL",
"adjusted": true,
"queryCount": 4,
"resultsCount": 4,
"results": [
{ "t": 1704171600000, "o": 187.15, "h": 188.44, "l": 183.885, "c": 185.64, "v": 82488674, "vw": 185.9374, "n": 1008875 },
...
],
"status": "OK",
"count": 4
}日K的 t 是该交易日美东时间 0 点的毫秒时间戳。
/v2/aggs/ticker/{ticker}/prev上一交易日的收盘K线。
{
"ticker": "AAPL",
"adjusted": true,
"queryCount": 1,
"resultsCount": 1,
"results": [
{ "T": "AAPL", "t": 1704171600000, "o": 187.15, "h": 188.44, "l": 183.885, "c": 185.64, "v": 82488674, "vw": 185.9374, "n": 1008875 }
],
"status": "OK",
"count": 1
}
/v2/aggs/grouped/locale/us/market/stocks/{date}某个交易日全市场股票的日线,量化回测/复盘常用。
/v1/open-close/{ticker}/{date}指定股票在某个交易日的开高低收。
/v3/reference/tickers股票/ETF 基础信息检索,支持按代码、交易所、状态过滤。
{
"results": [
{ "ticker": "AAPL", "name": "Apple Inc.", "market": "stocks", "locale": "us", "primary_exchange": "XNAS", "type": "CS", "active": true, "currency_name": "usd" }
],
"status": "OK",
"count": 1,
"next_url": "https://marilux.dev/v3/reference/tickers?cursor=..."
}next_url 已经改写成你自己的域名,直接翻页请求即可,不会带出上游地址或凭证。
/v3/reference/tickers/{ticker}单只股票/ETF 的详细资料:CIK、composite/share class FIGI、市值、行业分类(SIC)、上市日期等。
{
"results": {
"ticker": "AAPL", "name": "Apple Inc.", "cik": "0000320193",
"composite_figi": "BBG000B9XRY4", "share_class_figi": "BBG001S5N8V8",
"market_cap": 4669699774600, "sic_code": "3571", "sic_description": "ELECTRONIC COMPUTERS",
"list_date": "1980-12-12", "total_employees": 166000, "homepage_url": "https://www.apple.com",
"branding": {
"logo_url": "https://marilux.dev/v1/reference/company-branding/.../logo.svg",
"icon_url": "https://marilux.dev/v1/reference/company-branding/.../icon.png"
}
},
"status": "OK"
}注意:品牌图片(branding 里的 logo_url / icon_url)目前暂不提供下载,链接仅供参考,请求会失败;其余字段均可正常使用。
/v3/reference/splits拆股/合股历史,做复权价计算时和 dividends 是一对,缺一个都会算错。每个标的的拆股、分红和代码变更也可以在标的页直接查看,例如 NVDA、TSLA。
/v3/reference/dividends分红历史。
/stocks/v1/splits新版拆股/合股接口,比 /v3/reference/splits 多了 adjustment_type(正拆/反拆等)和 historical_adjustment_factor(历史复权因子,可直接乘到历史价格上)。参数 ticker、execution_date(支持 .gte/.lte),按日期倒序加 sort=execution_date.desc。
curl "https://marilux.dev/stocks/v1/splits?ticker=AAPL&sort=execution_date.desc&apiKey=mh_live_your_key"
{
"status": "OK",
"results": [
{ "ticker": "AAPL", "execution_date": "2020-08-31", "split_from": 1, "split_to": 4,
"adjustment_type": "forward_split", "historical_adjustment_factor": 0.25 }
]
}
/stocks/v1/dividends新版分红接口,比 /v3/reference/dividends 多了 historical_adjustment_factor(分红复权因子)和 split_adjusted_cash_amount(按拆股调整后的每股分红)。参数 ticker、ex_dividend_date(支持 .gte/.lte),按除息日倒序加 sort=ex_dividend_date.desc。
curl "https://marilux.dev/stocks/v1/dividends?ticker=AAPL&sort=ex_dividend_date.desc&limit=4&apiKey=mh_live_your_key"
{
"status": "OK",
"results": [
{ "ticker": "AAPL", "ex_dividend_date": "2026-08-10", "record_date": "2026-08-10", "pay_date": "2026-08-13",
"declaration_date": "2026-07-30", "cash_amount": 0.27, "currency": "USD", "frequency": 4,
"distribution_type": "recurring", "historical_adjustment_factor": 0.999138, "split_adjusted_cash_amount": 0.27 }
]
}
/v1/adj-factor/{ticker}逐日复权因子(本站提供),已把拆股和分红合并好,每个交易日一行。参数 from、to(YYYY-MM-DD,默认最近一年)。close 是不复权收盘价;前复权价 = close × qfq_factor(最新一天为 1),后复权价 = close × hfq_factor(上市后首次除权前为 1,跟查询区间无关,分段拉取可直接拼接)。前复权和后复权算出的涨跌幅完全相同。events 列出区间内的拆股(split)、除息日(dividend)和分拆(spinoff,cash_amount 是分到的股票按除权日收盘价折算的每股价值,如 ABT 2013-01-02 分拆 ABBV)。分红因子按除息日前一交易日收盘价计算;换过代码的证券(如 QQQ 早年的 QQQQ、META 早年的 FB)自动拼接成连续序列。需要整段 K 线文件可以直接用历史数据下载。注意:K线接口的 adjusted=true 只调整拆股、不含分红,计算收益率请用本接口。Starter 可查最近 5 年。示例里 2020-08-31 是 AAPL 1 拆 4 的生效日;已经按这个口径复权好的分钟线可以在历史数据下载直接下载。
curl "https://marilux.dev/v1/adj-factor/AAPL?from=2020-08-27&to=2020-08-31&apiKey=mh_live_your_key"
{
"status": "OK", "ticker": "AAPL", "from": "2020-08-27", "to": "2020-08-31", "count": 3,
"results": [
{ "date": "2020-08-27", "close": 500.04, "qfq_factor": 0.2422844578, "hfq_factor": 64.80442944 },
{ "date": "2020-08-28", "close": 499.23, "qfq_factor": 0.2422844578, "hfq_factor": 64.80442944 },
{ "date": "2020-08-31", "close": 129.04, "qfq_factor": 0.9691378312, "hfq_factor": 259.2177178 }
],
"events": [ { "date": "2020-08-31", "type": "split", "split_from": 1, "split_to": 4 } ]
}
/vX/reference/tickers/{id}/events代码变更历史(改名、换代码),{id} 可以是股票代码、CUSIP 或 composite FIGI。做历史回测时用它把旧代码对应到现在的公司,比如 FB → META。
curl "https://marilux.dev/vX/reference/tickers/META/events?apiKey=mh_live_your_key"
{
"results": {
"name": "Meta Platforms, Inc. Class A Common Stock", "composite_figi": "BBG000MM2P62", "cik": "0001326801",
"events": [
{ "type": "ticker_change", "date": "2022-06-09", "ticker_change": { "ticker": "META" } },
{ "type": "ticker_change", "date": "2012-05-18", "ticker_change": { "ticker": "FB" } }
]
},
"status": "OK"
}
/vX/reference/iposIPO 日历:即将上市、正在发行和已上市的新股,含发行价区间、最终发行价、发行股数、上市日期和状态。可按 ticker、ipo_status(如 pending、new、history、rumor、withdrawn)、listing_date.gte / listing_date.lte 筛选,sort=listing_date&order=desc 按上市日期倒序。数据每天更新。
curl "https://marilux.dev/vX/reference/ipos?ipo_status=pending&limit=10&apiKey=mh_live_your_key"
{
"results": [
{ "ticker": "GBC", "issuer_name": "Georgia Banking Co. Inc", "ipo_status": "direct_listing_process",
"announced_date": "2026-10-02", "primary_exchange": "XNAS", "security_type": "CS",
"max_shares_offered": 7040514, "lot_size": 100, "currency_code": "USD", "last_updated": "2026-10-15" }
],
"status": "OK",
"next_url": "https://marilux.dev/vX/reference/ipos?cursor=..."
}
/v3/reference/exchanges交易所列表及基础信息。
/v1/marketstatus/now当前市场开/收盘状态。
/v1/marketstatus/upcoming即将到来的休市安排。
/v2/snapshot/locale/us/markets/stocks/tickers全市场(或用 tickers= 指定的多只)股票快照,价格仍按上述延迟规则提供。
/v2/snapshot/locale/us/markets/stocks/tickers/{ticker}单只股票的快照。
/v2/snapshot/locale/us/markets/stocks/gainers当日涨幅榜。
/v2/snapshot/locale/us/markets/stocks/losers当日跌幅榜。
Advanced 专属接口
下面这些接口只有 Advanced 套餐的 Key 能用,Starter 套餐调用会收到 404。
/v3/trades/{ticker}Advanced 专属指定股票在时间范围内的逐笔成交数据(tick-level)。
curl "https://marilux.dev/v3/trades/AAPL?limit=1&apiKey=mh_live_your_key"
{
"results": [
{ "exchange": 12, "id": "133121", "price": 334.8, "size": 5, "conditions": [12,14,37,41],
"sip_timestamp": 1789775989256756500, "participant_timestamp": 1789775989256742000,
"sequence_number": 10448785, "tape": 3 }
],
"status": "OK"
}
/v3/quotes/{ticker}Advanced 专属指定股票在时间范围内的逐笔报价(NBBO 最优买卖价)。
curl "https://marilux.dev/v3/quotes/AAPL?limit=1&apiKey=mh_live_your_key"
/stocks/financials/v1/ratiosAdvanced 专属财务比率(估值、盈利能力、偿债能力等)。同一个 /stocks/financials/v1/ 前缀下还有 income-statements(利润表)、balance-sheets(资产负债表)、cash-flow-statements(现金流量表),按需替换路径最后一段。注意参数名不同:ratios 用 ticker,三张报表用 tickers(多一个 s),可再加 fiscal_year、fiscal_quarter、timeframe 筛选。参数名写错不会报错,而是返回未筛选的全市场数据。
curl "https://marilux.dev/stocks/financials/v1/ratios?ticker=AAPL&apiKey=mh_live_your_key" curl "https://marilux.dev/stocks/financials/v1/income-statements?tickers=AAPL&fiscal_year=2024&apiKey=mh_live_your_key"
{
"status": "OK",
"results": [
{ "ticker": "AAPL", "price": 336.13, "market_cap": 4905541723400,
"earnings_per_share": 8.83, "price_to_earnings": 38.05, "price_to_book": 45.62,
"dividend_yield": 0.0032, "return_on_equity": 1.1991, "debt_to_equity": 0.78 }
]
}
/stocks/v1/short-interestAdvanced 专属卖空持仓(每半月结算一次):卖空股数、日均成交量、回补天数。参数 ticker,按日期倒序可加 sort=settlement_date.desc。
curl "https://marilux.dev/stocks/v1/short-interest?ticker=AAPL&sort=settlement_date.desc&limit=1&apiKey=mh_live_your_key"
{
"status": "OK",
"results": [
{ "settlement_date": "2026-09-15", "ticker": "AAPL", "short_interest": 128753092,
"avg_daily_volume": 45135477, "days_to_cover": 2.85 }
]
}
/stocks/v1/short-volumeAdvanced 专属每日卖空成交量,含卖空占比 short_volume_ratio 以及各交易所明细。参数 ticker,按日期倒序可加 sort=date.desc。
curl "https://marilux.dev/stocks/v1/short-volume?ticker=AAPL&sort=date.desc&limit=1&apiKey=mh_live_your_key"
{
"status": "OK",
"results": [
{ "ticker": "AAPL", "date": "2026-09-25", "total_volume": 11119362.83,
"short_volume": 6485654.25, "short_volume_ratio": 58.33, "exempt_volume": 66813 }
]
}
/stocks/vX/floatAdvanced 专属流通股数量及流通比例。参数 ticker。
curl "https://marilux.dev/stocks/vX/float?ticker=AAPL&apiKey=mh_live_your_key"
{
"status": "OK",
"results": [
{ "ticker": "AAPL", "free_float": 13521179933, "free_float_percent": 92.1,
"effective_date": "2026-05-14" }
]
}
/v2/reference/newsAdvanced 专属美股新闻:标题、摘要、发布时间、原文链接、关联股票代码、关键词,以及针对每只股票的情绪标签(positive / negative / neutral)和判断理由。来源有 Zacks、The Motley Fool、GlobeNewswire 等,每天约 700 条,最早到 2016 年(各股票起点不同)。不含新闻全文,全文请打开 article_url。常用参数:ticker、published_utc.gte / published_utc.lte(ISO 时间或日期)、order、sort=published_utc、limit(最大 1000),翻页用返回的 next_url。
curl "https://marilux.dev/v2/reference/news?ticker=NVDA&order=desc&limit=10&apiKey=mh_live_your_key"
{
"status": "OK",
"results": [
{ "title": "…", "author": "…", "published_utc": "2026-11-10T02:39:00Z",
"article_url": "https://…", "tickers": ["NVDA"], "description": "…",
"publisher": { "name": "GlobeNewswire Inc.", "homepage_url": "https://www.globenewswire.com" },
"insights": [ { "ticker": "NVDA", "sentiment": "negative", "sentiment_reasoning": "…" } ] }
],
"next_url": "https://marilux.dev/v2/reference/news?cursor=…"
}