Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 150 additions & 0 deletions docs/en/docs/quote/options/option-chain.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
---
slug: /quote/pull/option-chain
title: Option Chain
sidebar_position: 11
language_tabs: false
toc_footers: []
includes: []
search: true
highlight_theme: ''
headingLevel: 2
---

Get the option contract list of an underlying security for a given expiry date.

Every contract is an independent entry: calls and puts are not paired, so a strike price
that is listed on one side only yields a single entry.

## Request

<table className="http-basic">
<tbody>
<tr><td className="http-basic-key">HTTP Method</td><td>GET</td></tr>
<tr><td className="http-basic-key">HTTP URL</td><td>/v1/gemini/option/option_chain_list</td></tr>
</tbody>
</table>

### Query Parameters

| Name | Type | Required | Description |
| ------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| symbol | string | YES | Underlying security code, in `ticker.region` format, e.g. `BABA.US` |
| expiry_date | string | YES | Option expiry date, in `YYYYMMDD` format, e.g. `20261218` |
| standard_only | bool | NO | Whether to filter out old option contracts generated by corporate actions. `true` / `1` returns standard contracts only. When omitted or `false`, both standard contracts and contracts carrying `standard_attr` = `old` are returned |

### Request Example

<Tabs groupId="request-example">
<TabItem value="curl" label="cURL" default>

```bash
curl "https://openapi.longbridge.com/v1/gemini/option/option_chain_list?symbol=BABA.US&expiry_date=20261218" \
-H "Authorization: Bearer <token>" \
-H "Accept: application/json"
```

</TabItem>
</Tabs>

## Response

### Response Headers

- Content-Type: application/json

### Ordering

The list is returned in a fixed order: standard contracts first, then the contracts carrying
`standard_attr` = `old`. Within each group, entries are ordered by `option_type`, then by
`strike_price` ascending, then calls before puts.

### Response Example

```json
{
"code": 0,
"message": "success",
"data": {
"list": [
{
"expiry_date": "20261218",
"strike_price": "50",
"direction": "C",
"symbol": "BABA261218C50000.US",
"standard_attr": "",
"option_type": "",
"days_to_expiry": 106
},
{
"expiry_date": "20261218",
"strike_price": "50",
"direction": "P",
"symbol": "BABA261218P50000.US",
"standard_attr": "",
"option_type": "",
"days_to_expiry": 106
},
{
"expiry_date": "20261218",
"strike_price": "55",
"direction": "C",
"symbol": "BABA261218C55000.US",
"standard_attr": "",
"option_type": "",
"days_to_expiry": 106
},
{
"expiry_date": "20261218",
"strike_price": "55",
"direction": "P",
"symbol": "BABA261218P55000.US",
"standard_attr": "",
"option_type": "",
"days_to_expiry": 106
},
{
"expiry_date": "20261218",
"strike_price": "10",
"direction": "C",
"symbol": "BABA2261218C10000.US",
"standard_attr": "old",
"option_type": "",
"days_to_expiry": 106
},
{
"expiry_date": "20261218",
"strike_price": "10",
"direction": "P",
"symbol": "BABA2261218P10000.US",
"standard_attr": "old",
"option_type": "",
"days_to_expiry": 106
}
]
}
}
```

### Response Status

| Status | Description | Schema |
| ------ | -------------- | --------------------------------------------------------- |
| 200 | Success | [option_chain_response](#schemaoption_chain_response) |
| 500 | Internal error | None |

## Schemas

### option_chain_response

<a id="schemaoption_chain_response"></a>

| Name | Type | Required | Description |
| ---------------- | -------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| list | object[] | true | Option contract list |
| ∟ expiry_date | string | true | Expiry date in US Eastern time, in `YYYYMMDD` format |
| ∟ strike_price | string | true | Strike price |
| ∟ direction | string | true | Contract direction. `C`: call; `P`: put |
| ∟ symbol | string | true | Option contract code, in `ticker.region` format |
| ∟ standard_attr | string | true | Indicates whether the contract is an old contract resulting from a corporate action (e.g. stock split, merger). `old` indicates a legacy contract; empty indicates a normal active contract |
| ∟ option_type | string | true | Special expiration cycle type. `W`: weekly option (expires weekly); `Q`: quarterly option (expires quarterly); empty indicates a standard monthly option |
| ∟ days_to_expiry | int32 | true | The number of days remaining until the option expires, updated daily at midnight ET. The value is `0` for options expiring today, and negative for already-expired options |
2 changes: 1 addition & 1 deletion docs/en/docs/quote/options/option-quote.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ longbridge option quote TSLA260418P350000.US

| Name | Type | Required | Description |
| ------ | -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| symbol | string[] | Yes | Security code list. obtain the symbol of the options through the [optionchain](./optionchain-date-strike.md) API, for example: `[BABA230120C160000.US]` <br /><br />**Check rules:**<br />The maximum number of symbols in each request is `500` |
| symbol | string[] | Yes | Security code list. obtain the symbol of the options through the option chain API, for example: `[BABA230120C160000.US]` <br /><br />**Check rules:**<br />The maximum number of symbols in each request is `500` |

### Protobuf

Expand Down
Loading
Loading