Longbridge Developers
立即开始

日度成交量

获取美股期权的历史每日认购/认沽成交量和未平仓量数据。

>_ CLI
longbridge option volume daily AAPL.US
longbridge option volume daily TSLA.US --count 60

Parameters

SDK 方法参数。

NameTypeRequiredDescription
symbolstringYESUnderlying US stock symbol, e.g. AAPL.US, TSLA.US
timestampintegerNOStart Unix timestamp (seconds); 0 returns the most recent (default 0)
countintegerNONumber of trading days to return (default 30)

Go SDK 使用 start / end 日期区间(time.Time)而非 timestamp / count。

Request Example

>_ CLI
longbridge option volume daily AAPL.US
longbridge option volume daily TSLA.US --count 60
from longbridge.openapi import QuoteContext, Config, OAuthBuilder

oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url))
config = Config.from_oauth(oauth)
ctx = QuoteContext(config)

resp = ctx.option_volume_daily("AAPL.US", count=30)
print(resp)
import asyncio
from longbridge.openapi import AsyncQuoteContext, Config, OAuthBuilder

async def main() -> None:
    oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url))
    config = Config.from_oauth(oauth)
    ctx = AsyncQuoteContext.create(config)

    resp = await ctx.option_volume_daily("AAPL.US", count=30)
    print(resp)

if __name__ == "__main__":
    asyncio.run(main())
const { Config, QuoteContext, OAuth } = require('longbridge')

async function main() {
  const oauth = await OAuth.build('your-client-id', (_, url) => {
    console.log('Open this URL to authorize: ' + url)
  })
  const config = Config.fromOAuth(oauth)
  const ctx = QuoteContext.new(config)
  const resp = await ctx.optionVolumeDaily('AAPL.US', 0, 30)
  console.log(resp)
}
main().catch(console.error)
import com.longbridge.*;
import com.longbridge.quote.*;

class Main {
    public static void main(String[] args) throws Exception {
        try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get();
             Config config = Config.fromOAuth(oauth);
             QuoteContext ctx = QuoteContext.create(config)) {
            OptionVolumeDailyOptions opts = new OptionVolumeDailyOptions();
            opts.symbol = "AAPL.US";
            opts.count = 30;
            var resp = ctx.getOptionVolumeDaily(opts).get();
            System.out.println(resp);
        }
    }
}
use std::sync::Arc;
use longbridge::{oauth::OAuthBuilder, quote::QuoteContext, Config};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?;
    let config = Arc::new(Config::from_oauth(oauth));
    let (ctx, _) = QuoteContext::new(config);
    let resp = ctx.option_volume_daily("AAPL.US", 0, 30).await?;
    println!("{:?}", resp);
    Ok(())
}
#include &lt;iostream&gt;
#include <longbridge.hpp>

using namespace longbridge;
using namespace longbridge::quote;

int main() {
    OAuthBuilder("your-client-id").build(
        [](const std::string& url) { std::cout << "Open: " << url << std::endl; },
        [](auto res) {
            if (!res) return;
            Config config = Config::from_oauth(*res);
            QuoteContext ctx = QuoteContext::create(config);
            ctx.option_volume_daily("AAPL.US", 0, 30, [](auto resp) {
                if (resp) std::cout << resp->size() << std::endl;
            });
        });
    std::cin.get();
}
package main

import (
	"context"
	"fmt"
	"log"
	"time"

	"github.com/longbridge/openapi-go/config"
	"github.com/longbridge/openapi-go/oauth"
	"github.com/longbridge/openapi-go/quote"
)

func main() {
	o := oauth.New("your-client-id").
		OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) })
	if err := o.Build(context.Background()); err != nil {
		log.Fatal(err)
	}
	conf, err := config.New(config.WithOAuthClient(o))
	if err != nil {
		log.Fatal(err)
	}
	qctx, err := quote.NewFromCfg(conf)
	if err != nil {
		log.Fatal(err)
	}
	defer qctx.Close()
	end := time.Now()
	start := end.AddDate(0, 0, -30)
	resp, err := qctx.OptionVolumeDaily(context.Background(), "AAPL.US", start, end)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", resp)
}

Response

Response Example

{
  "code": 0,
  "message": "success",
  "data": {
    "symbol": "AAPL.US",
    "stats": [
      {
        "symbol": "AAPL.US",
        "date": "2026-05-07",
        "call_volume": 284512,
        "put_volume": 195830,
        "call_open_interest": 1824500,
        "put_open_interest": 1532100,
        "total_volume": 480342,
        "total_open_interest": 3356600,
        "pc_vol": 0.6886,
        "pc_oi": 0.8398
      }
    ]
  }
}

Response Status

StatusDescriptionSchema
200Successoption_volume_daily_rsp
400Bad requestNone

Schemas

option_volume_daily_rsp

NameTypeRequiredDescription
symbolstringtrueSecurity symbol
statsobject[]trueDaily volume records
∟ symbolstringtrueSecurity symbol
∟ datestringtrueDate in YYYY-MM-DD format
∟ call_volumeint64trueCall volume on that day
∟ put_volumeint64truePut volume on that day
∟ call_open_interestint64trueCall open interest
∟ put_open_interestint64truePut open interest
∟ total_volumeint64trueTotal options volume
∟ total_open_interestint64trueTotal options open interest
∟ pc_volfloattruePut/call volume ratio
∟ pc_oifloattruePut/call open interest ratio