Skip to content

Bulk Trade Quote

StandardPro

REQUIRED

The Theta Terminal must be running to access data.

Behavior

Returns the data for all contracts that share the same provided root and expiration.
Returns every trade
reported by OPRA paired with the last NBBO quote
reported by OPRA at the time of trade. A quote
is matched with a trade if its timestamp <= the trade timestamp. To
match trades with quotes timestamps that are < the trade timestamp, specify the
exclusiveparameter to true. After thorough testing, we have determined that using
exclusive=true might yield better results for various applications.

Sample URL & Code

Paste the URL below into your browser while the Theta Terminal is running.
You can use the "request sample" box to the right of this box obtain sample
code in any programming language.

http://127.0.0.1:25510/v2/bulk_hist/option/trade_quote?root=AAPL&exp=20231117&start_date=20231110&end_date=20231110

Parameters

Query Parameters

expRequired  -

The expiration date of the option contract formatted as YYYYMMDD.

Type: integer (Default: 20231103)
start_dateRequired  -

The start date (inclusive) of the request formatted as YYYYMMDD.

Type: integer (Default: 20230915)
end_dateRequired  -

The end date (inclusive) of the request formatted as YYYYMMDD.

Type: integer (Default: 20230915)
use_csvRequired  -

Uses CSV if true, legacy JSON if false.

Type: boolean (Default: false)
rootRequired  -

The symbol of the security. Option underlyings for indices might have special tickers.

Type: string (Default: SPX)
exclusive  -

If you prefer to match quotes with timestamps that are < the trade timestamp, specify this parameter to true. This parameter only works with the trade_quote endpoint.

Type: boolean (Default: false)

Responses

OK
JSON
{
"header": {
"id": 0,
"latency_ms": 0,
"error_type": "string",
"error_msg": "string",
"next_page": null,
"format": [
"ms_of_day",
"sequence",
"ext_condition1",
"ext_condition2",
"ext_condition3",
"ext_condition4",
"condition",
"size",
"exchange",
"price",
"condition_flags",
"price_flags",
"volume_type",
"records_back",
"ms_of_day2",
"bid_size",
"bid_exchange",
"bid",
"bid_condition",
"ask_size",
"ask_exchange",
"ask",
"ask_condition",
"date"
]
},
"response": [
{
"ticks": [
[
56167951,
299720858,
255,
255,
255,
255,
18,
1,
42,
86.15,
0,
7,
0,
0,
56167951,
12,
47,
86,
50,
1,
47,
86.2,
50,
20231110
]
],
"contract": {
"root": "AAPL",
"expiration": 20231117,
"strike": 100000,
"right": "C"
}
},
{
"ticks": [
[
41064023,
-745524183,
255,
255,
255,
255,
125,
1,
43,
79.9,
0,
7,
0,
0,
41051889,
14,
47,
79.75,
50,
3,
31,
80,
50,
20231110
],
[
43614362,
-561477748,
255,
255,
255,
255,
125,
1,
9,
79.97,
0,
3,
0,
0,
43614362,
13,
7,
79.85,
50,
13,
7,
80.1,
50,
20231110
]
],
"contract": {
"root": "AAPL",
"expiration": 20231117,
"strike": 105000,
"right": "C"
}
}
]
}

Sample Code

py