-
Notifications
You must be signed in to change notification settings - Fork 1
/
tradier.yaml
582 lines (576 loc) · 16.3 KB
/
tradier.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
openapi: 3.0.1
info:
version: 'v1'
title: Tradier API
# Added by API Auto Mocking Plugin
servers:
- description: Tradier Sandbox
url: https://sandbox.tradier.com/v1
components:
schemas:
symbol:
type: string
option:
type: object
properties:
symbol:
type: string
description:
type: string
exch:
type: string
last:
type: number
change:
type: number
volume:
type: number
open:
type: number
high:
type: number
low:
type: number
close:
type: number
bid:
type: number
ask:
type: number
underlying:
$ref: "#/components/schemas/symbol"
strike:
type: number
change_percentage:
type: number
average_volume:
type: number
last_volume:
type: number
trade_date:
type: number
prevclose:
type: number
week_52_high:
type: number
week_52_low:
type: number
bidsize:
type: number
bidexch:
type: string
bid_date:
type: number
description: unix time
asksize:
type: number
ask_date:
type: number
open_interest:
type: number
contract_size:
type: number
expiration_date:
type: string
format: date
expiration_type:
type: string
enum: [standard, weeklys, eom]
option_type:
type: string
enum: [call, put]
root_symbol:
$ref: "#/components/schemas/symbol"
greeks:
type: object
properties:
delta:
type: number
format: double
description: Delta (Δ) represents the rate of change between the option's price and a $1 change in the underlying asset's price.
gamma:
type: number
format: double
description: Gamma (Γ) represents the rate of change between an option's delta and the underlying asset's price.
thetha:
type: number
format: double
description: Theta (Θ) represents the rate of change between the option price and time, or time sensitivity - sometimes known as an option's time decay.
vega:
type: number
format: double
description: Vega (v) represents the rate of change between an option's value and the underlying asset's implied volatility.
rho:
type: number
format: double
description: Rho (p) represents the rate of change between an option's value and a 1% change in the interest rate.
phi:
type: number
format: double
description: Phi indicates the expected change in the option premium due to a small change in the foreign currency interest rate.
bid_iv:
type: number
format: float
description: Bid implied volatility
mid_iv:
type: number
format: float
description: Mid implied volatility
ask_iv:
type: number
format: float
description: Ask implied volatility
smv_vol:
type: number
format: float
description: ORATS final implied volatility
updated_at:
type: string
format: date-time
streamingSummary:
type: object
properties:
high:
type: number
low:
type: number
open:
type: number
prevClose:
type: number
symbol:
$ref: '#/components/schemas/symbol'
type:
type: string
streamingQuote:
type: object
properties:
ask:
type: number
askdate:
type: string
pattern: '^[0-9]+$'
askexch:
type: string
asksz:
type: number
bid:
type: number
biddate:
type: string
pattern: '^[0-9]+$'
bidexch:
type: string
symbol:
$ref: '#/components/schemas/symbol'
type:
type: string
streamingTrade:
type: object
properties:
cvol:
type: string
pattern: '^[0-9]+$'
date:
type: string
pattern: '^[0-9]+$'
last:
type: string
price:
type: string
size:
type: string
symbol:
$ref: '#/components/schemas/symbol'
exch:
type: string
type:
type: string
streamingTimesale:
type: object
properties:
symbol:
$ref: '#/components/schemas/symbol'
exch:
type: string
bid:
type: string
format: number
ask:
type: string
format: number
last:
type: string
format: number
size:
type: string
format: number
date:
type: string
pattern: '^[0-9]+$'
seq:
type: number
flag:
type: string
cancel:
type: boolean
correction:
type: boolean
session:
type: string
streamingTradex:
type: object
properties:
cvol:
type: string
pattern: '^[0-9]+$'
date:
type: string
pattern: '^[0-9]+$'
last:
type: string
price:
type: string
size:
type: string
exch:
type: string
symbol:
$ref: '#/components/schemas/symbol'
type:
type: string
profile:
'$ref': './profile.yaml'
quote:
'$ref': './quote.yaml'
quotes:
type: object
properties:
quotes:
type: object
properties:
quote:
type: array
items:
'$ref': '#/components/schemas/quote'
securitySchemes:
BearerAuth:
scheme: bearer
type: http
paths:
/markets/quotes:
post:
description: |
Get a list of symbols using a keyword lookup on the symbols description. Results are in descending order by average volume of the security. This can be used for simple search functions.
security:
- BearerAuth: []
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
required: [symbols]
properties:
symbols:
type: array
items:
$ref: "#/components/schemas/symbol"
greeks:
default: false
type: boolean
responses:
'2XX':
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/quotes"
get:
description: |
Get a list of symbols using a keyword lookup on the symbols description. Results are in descending order by average volume of the security. This can be used for simple search functions.
security:
- BearerAuth: []
parameters:
- in: query
name: symbols
required: true
schema:
type: array
items:
$ref: "#/components/schemas/symbol"
style: simple
explode: false
- in: query
name: greeks
schema:
type: boolean
responses:
'2XX':
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/quotes"
/markets/options/chains:
get:
description: |
Get all quotes in an option chain. Greek and IV data is included courtesy of ORATS. Please check out their APIs for more in-depth options data.
security:
- BearerAuth: []
parameters:
- in: query
name: symbol
schema:
$ref: "#/components/schemas/symbol"
required: true
- in: query
name: expiration
required: true
schema:
type: string
format: date
- in: query
name: greeks
schema:
type: boolean
responses:
'2XX':
description: OK
content:
application/json:
schema:
type: object
properties:
options:
type: object
properties:
option:
type: array
items:
$ref: '#/components/schemas/option'
/markets/options/expirations:
get:
description: |
Get expiration dates for a particular underlying.
Note that some underlying securities use a different symbol for their weekly options (RUT/RUTW, SPX/SPXW). To make sure you see all expirations, make sure to send the includeAllRoots parameter. This will also ensure any unique options due to corporate actions (AAPL1) are returned.
security:
- BearerAuth: []
parameters:
- in: query
name: symbol
schema:
$ref: "#/components/schemas/symbol"
required: true
description: Underlying symbol of the chain
- in: query
name: includeAllRoots
schema:
type: boolean
default: false
required: false
description: Send expirations related to all option roots
- in: query
name: strikes
schema:
type: boolean
default: false
required: false
responses:
'2XX':
description: OK
content:
application/json:
schema:
type: object
required: [expirations]
properties:
expirations:
type: object
properties:
date:
type: array
items:
type: string
format: date
expiration:
type: array
items:
type: object
properties:
date:
type: string
format: date
strikes:
type: object
properties:
strike:
type: array
items:
type: number
/markets/options/strikes:
get:
description: |
Get an options strike prices for a specified expiration date.
security:
- BearerAuth: []
parameters:
- in: query
name: symbol
schema:
type: string
required: true
description: Underlying symbol of the chain
# TODO: Determine format
- in: query
name: expiration
schema:
type: string
format: date
responses:
'2XX':
description: OK
content:
application/json:
schema:
type: object
properties:
strikes:
type: object
properties:
strike:
type: array
items:
type: number
format: float
/markets/options/lookup:
get:
description: |
Get all options symbols for the given underlying. This will include additional option roots (ex. SPXW, RUTW) if applicable.
security:
- BearerAuth: []
parameters:
- in: query
name: underlying
schema:
type: string
required: true
description: Underlying symbol of the chain
# TODO: Determine format
responses:
'2XX':
description: OK
content:
application/json:
schema:
type: object
properties:
symbols:
type: array
items:
type: object
properties:
rootSymbol:
$ref: "#/components/schemas/symbol"
options:
type: array
items:
type: string
/user/profile:
get:
description: |
The user’s profile contains information pertaining to the user and his/her accounts. In addition to listing all the accounts a user has, this call should be used to create a personalized experience for your customers (i.e. displaying their name when they log in).
security:
- BearerAuth: []
responses:
'2XX':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/profile'
/markets/events/session:
post:
description: |
Create a streaming session for use with the Tradier Streaming API. This session can be used with the streaming endpoints to obtain updates to the market as they happen.
security:
- BearerAuth: []
responses:
'2XX':
description: OK
content:
application/json:
schema:
type: object
properties:
stream:
type: object
properties:
url:
type: string
format: uri
sessionid:
type: string
format: uuid
/markets/history:
get:
description: |
Get historical pricing for a security. This data will usually cover the entire lifetime of the company if sending reasonable start/end times. You can fetch historical pricing for options by passing the OCC option symbol (ex. AAPL220617C00270000) as the symbol.
security:
- BearerAuth: []
parameters:
- in: query
name: symbol
schema:
$ref: '#/components/schemas/symbol'
required: true
- in: query
name: interval
schema:
type: string
enum: [daily, weekly, monthly]
- in: query
name: start
schema:
type: string
format: date
- in: query
name: end
schema:
type: string
format: date
responses:
'2XX':
description: OK
content:
application/json:
schema:
type: object
properties:
history:
type: object
properties:
day:
type: array
items:
type: object
properties:
date:
type: string
format: date
open:
type: number
format: float
high:
type: number
format: float
low:
type: number
format: float
close:
type: number
format: float
volume:
type: number
format: int64
security:
- BearerAuth: []