Developer docs

美股行情接口

美股股票与 ETF 的K线、快照、参考数据和公司行为;高级版额外提供逐笔成交/报价、财务与卖空数据。

通用接口

下面这些接口 Starter 和 Advanced 套餐都能用,覆盖美股股票与 ETF 的聚合行情、历史K线与参考数据。逐笔成交/报价、财务数据是 Advanced 专属,见本页下方 Advanced 专属接口;WebSocket 实时推送见 WebSocket 实时推送;期权数据需要单独开通期权套餐,见期权数据一节;指数、外汇与期货暂不提供。

GET/v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from}/{to}

指定时间粒度和区间的历史K线(聚合行情)。

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 点的毫秒时间戳。

查看 Massive 官方参数文档 →

GET/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
}

查看 Massive 官方参数文档 →

GET/v2/aggs/grouped/locale/us/market/stocks/{date}

某个交易日全市场股票的日线,量化回测/复盘常用。

查看 Massive 官方参数文档 →

GET/v1/open-close/{ticker}/{date}

指定股票在某个交易日的开高低收。

查看 Massive 官方参数文档 →

GET/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 已经改写成你自己的域名,直接翻页请求即可,不会带出上游地址或凭证。

查看 Massive 官方参数文档 →

GET/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)目前暂不提供下载,链接仅供参考,请求会失败;其余字段均可正常使用。

查看 Massive 官方参数文档 →

GET/v3/reference/splits

拆股/合股历史,做复权价计算时和 dividends 是一对,缺一个都会算错。

查看 Massive 官方参数文档 →

GET/v3/reference/dividends

分红历史。

查看 Massive 官方参数文档 →

GET/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 }
  ]
}
GET/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 }
  ]
}
GET/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"
}
GET/vX/reference/ipos

IPO 日历:即将上市、正在发行和已上市的新股,含发行价区间、最终发行价、发行股数、上市日期和状态。可按 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=..."
}

查看 Massive 官方参数文档 →

GET/v3/reference/exchanges

交易所列表及基础信息。

查看 Massive 官方参数文档 →

GET/v1/marketstatus/now

当前市场开/收盘状态。

查看 Massive 官方参数文档 →

GET/v1/marketstatus/upcoming

即将到来的休市安排。

查看 Massive 官方参数文档 →

GET/v2/snapshot/locale/us/markets/stocks/tickers

全市场(或用 tickers= 指定的多只)股票快照,价格仍按上述延迟规则提供。

查看 Massive 官方参数文档 →

GET/v2/snapshot/locale/us/markets/stocks/tickers/{ticker}

单只股票的快照。

查看 Massive 官方参数文档 →

GET/v2/snapshot/locale/us/markets/stocks/gainers

当日涨幅榜。

查看 Massive 官方参数文档 →

GET/v2/snapshot/locale/us/markets/stocks/losers

当日跌幅榜。

查看 Massive 官方参数文档 →

Advanced 专属接口

下面这些接口只有 Advanced 套餐的 Key 能用,Starter 套餐调用会收到 404。

GET/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"
}

查看 Massive 官方参数文档 →

GET/v3/quotes/{ticker}Advanced 专属

指定股票在时间范围内的逐笔报价(NBBO 最优买卖价)。

curl "https://marilux.dev/v3/quotes/AAPL?limit=1&apiKey=mh_live_your_key"

查看 Massive 官方参数文档 →

GET/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 }
  ]
}

查看 Massive 官方参数文档 →

GET/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 }
  ]
}
GET/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 }
  ]
}
GET/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" }
  ]
}