Skip to main content

Get Option Chain Info By Date

This API is used to obtain a list of option securities by the option chain expiry date.

SDK Links

Python
longport.openapi.QuoteContext.option_chain_info_by_date
Rust
longport::quote::QuoteContext#option_chain_info_by_date
Go
QuoteContext.OptionChainInfoByDate
Node.js
QuoteContext#optionChainInfoByDate

Request

Parameters

NameTypeRequiredDescription
symbolstringYesSecurity code, in ticker.region format, for example:700.HK
expiry_datestringYesOption expiry date,in YYMMDD format, for example: 20220429, obtained by Option Expiry Date API

Protobuf

message OptionChainDateStrikeInfoRequest {
string symbol = 1;
string expiry_date = 2;
}

Request Example

# Get Option Chain Info By Date
# https://open.longportapp.com/docs/quote/pull/optionchain-date-strike
# Before running, please visit the "Developers to ensure that the account has the correct quotes authority.
# If you do not have the quotes authority, you can enter "Me - My Quotes - Store" to purchase the authority through the "LongPort" mobile app.
from datetime import date
from longport.openapi import QuoteContext, Config

config = Config.from_env()
ctx = QuoteContext(config)

resp = ctx.option_chain_info_by_date("AAPL.US", date(2023, 1, 20))
print(resp)

Response

Response Properties

NameTypeDescription
strike_price_infoobject[]Option security info
∟ pricestringStrike price
∟ call_symbolstringSecurity code of call option
∟ put_symbolstringSecurity code of put option
∟ standardboolIs standard

Protobuf

message OptionChainDateStrikeInfoResponse {
repeated StrikePriceInfo strike_price_info = 1;
}

message StrikePriceInfo {
string price = 1;
string call_symbol = 2;
string put_symbol = 3;
bool standard = 4;
}

Response JSON Example

{
"strike_price_info": [
{
"price": "100",
"call_symbol": "AAPL220429C100000.US",
"put_symbol": "AAPL220429P100000.US",
"standard": true
},
{
"price": "105",
"call_symbol": "AAPL220429C105000.US",
"put_symbol": "AAPL220429P105000.US",
"standard": true
},
{
"price": "110",
"call_symbol": "AAPL220429C110000.US",
"put_symbol": "AAPL220429P110000.US",
"standard": true
},
{
"price": "115",
"call_symbol": "AAPL220429C115000.US",
"put_symbol": "AAPL220429P115000.US",
"standard": true
}
]
}

Error Code

Protocol Error CodeBusiness Error CodeDescriptionTroubleshooting Suggestions
3301600Invalid requestInvalid request parameters or unpacking request failed
3301606Request rate limitReduce the frequency of requests
7301602Server errorPlease try again or contact a technician to resolve the issue
7301600Invalue request parametersPlease check the request parameter: symbolexpiry_date