@gitchrisqueen/tdameritrade-api-js-client
Version:
TD Ameritrade API integration for node.js
1,660 lines (1,659 loc) • 171 kB
YAML
openapi: 3.0.0
info:
title: TD Ameritrade API - OAuth2
description: This is replication of the TD Ameritrade API.
version: 0.1.4
servers:
- url: https://api.tdameritrade.com/v1
security:
- application:
- read
- write
paths:
/oauth2/token:
post:
tags:
- Authentication
summary: Post Access Token
description: The token endpoint returns an access token along with an optional
refresh token.
operationId: oauth2TokenPOST
requestBody:
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/PostAccessBody'
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/EASObject'
"400":
description: An error message indicating the validation problem with the
request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"401":
description: An error message indicating the caller must pass valid credentials
in the request body.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"500":
description: An error message indicating there was an unexpected server
error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"403":
description: An error message indicating the caller doesn't have access
to the account in the request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"503":
description: An error message indicating there is a temporary problem responding.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security: []
x-swagger-router-controller: Authentication
/accounts/{accountId}/orders/{orderId}:
get:
tags:
- Orders
summary: Get Order
description: Get a specific order for a specific account.
operationId: accountsAccountIdOrdersOrderIdGET
parameters:
- name: accountId
in: path
required: true
style: simple
explode: false
schema:
type: integer
- name: orderId
in: path
required: true
style: simple
explode: false
schema:
type: integer
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/OrderGet'
"400":
description: An error message indicating the validation problem with the
request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"401":
description: An error message indicating the caller must pass a valid AuthToken
in the HTTP authorization request header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"500":
description: An error message indicating there was an unexpected server
error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"403":
description: An error message indicating the caller is forbidden from accessing
this page.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- bearerAuth: []
x-swagger-router-controller: Orders
put:
tags:
- Orders
summary: Replace Order
description: Replace an existing order for an account. The existing order will
be replaced by the new order. Once replaced, the old order will be canceled
and a new order will be created. See our Place Order Samples Guide - https://developer.tdameritrade.com/content/place-order-samples.
operationId: accountsAccountIdOrdersOrderIdPUT
parameters:
- name: accountId
in: path
required: true
style: simple
explode: false
schema:
type: integer
- name: orderId
in: path
required: true
style: simple
explode: false
schema:
type: integer
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OrderGet'
responses:
"200":
description: OK
"400":
description: An error message indicating the validation problem with the
request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"401":
description: An error message indicating the caller must pass a valid AuthToken
in the HTTP authorization request header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"500":
description: An error message indicating there was an unexpected server
error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"403":
description: An error message indicating the caller is forbidden from accessing
this page.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"404":
description: An error message if the order was not found.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- bearerAuth: []
x-swagger-router-controller: Orders
delete:
tags:
- Orders
summary: Cancel Order
description: Cancel a specific order for a spcific account
operationId: accountsAccountIdOrdersOrderIdDELETE
parameters:
- name: accountId
in: path
required: true
style: simple
explode: false
schema:
type: integer
- name: orderId
in: path
required: true
style: simple
explode: false
schema:
type: integer
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"400":
description: An error message indicating the validation problem with the
request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"401":
description: An error message indicating the caller must pass a valid AuthToken
in the HTTP authorization request header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"500":
description: An error message indicating there was an unexpected server
error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"403":
description: An error message indicating the caller is forbidden from accessing
this page.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"404":
description: An error message if the order was not found.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- bearerAuth: []
x-swagger-router-controller: Orders
/accounts/{accountId}/orders:
get:
tags:
- Orders
summary: Get Orders by Path
description: Orders for a specific account.
operationId: accountsAccountIdOrdersGET
parameters:
- name: accountId
in: path
required: true
style: simple
explode: false
schema:
type: integer
- name: maxResults
in: query
required: false
style: form
explode: true
schema:
type: integer
- name: fromEnteredTime
in: query
required: false
style: form
explode: true
schema:
type: string
format: date-time
- name: toEnteredTime
in: query
required: false
style: form
explode: true
schema:
type: string
format: date-time
- name: status
in: query
required: false
style: form
explode: true
schema:
type: string
enum:
- AWAITING_PARENT_ORDER
- AWAITING_CONDITION
- AWAITING_MANUAL_REVIEW
- ACCEPTED
- AWAITING_UR_OUT
- PENDING_ACTIVATION
- QUEUED
- WORKING
- REJECTED
- PENDING_CANCEL
- CANCELED
- PENDING_REPLACE
- REPLACED
- FILLED
- EXPIRED
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/OrderGet'
"400":
description: An error message indicating the validation problem with the
request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"401":
description: An error message indicating the caller must pass a valid AuthToken
in the HTTP authorization request header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"500":
description: An error message indicating there was an unexpected server
error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"403":
description: An error message indicating the caller is forbidden from accessing
this page.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- bearerAuth: []
x-swagger-router-controller: Orders
/orders:
get:
tags:
- Orders
summary: Get Orders By Query
description: All orders for a specific account or, if account ID isn't specified,
orders will be returned for all linked accounts.
operationId: ordersGET
parameters:
- name: accountId
in: query
required: false
style: form
explode: true
schema:
type: integer
- name: maxResults
in: query
required: false
style: form
explode: true
schema:
type: integer
- name: fromEnteredTime
in: query
required: false
style: form
explode: true
schema:
type: string
format: date-time
- name: toEnteredTime
in: query
required: false
style: form
explode: true
schema:
type: string
format: date-time
- name: status
in: query
required: false
style: form
explode: true
schema:
type: string
enum:
- AWAITING_PARENT_ORDER
- AWAITING_CONDITION
- AWAITING_MANUAL_REVIEW
- ACCEPTED
- AWAITING_UR_OUT
- PENDING_ACTIVATION
- QUEUED
- WORKING
- REJECTED
- PENDING_CANCEL
- CANCELED
- PENDING_REPLACE
- REPLACED
- FILLED
- EXPIRED
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/OrderGet'
"400":
description: An error message indicating the validation problem with the
request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"401":
description: An error message indicating the caller must pass a valid AuthToken
in the HTTP authorization request header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"500":
description: An error message indicating there was an unexpected server
error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"403":
description: An error message indicating the caller is forbidden from accessing
this page.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- bearerAuth: []
x-swagger-router-controller: Orders
post:
tags:
- Orders
summary: Place Order
description: Place an order for a specific account. See our Place Order Samples
Guide - https://developer.tdameritrade.com/content/place-order-samples.
operationId: ordersPOST
parameters:
- name: accountId
in: path
required: true
style: simple
explode: false
schema:
type: integer
requestBody:
content:
application/Json:
schema:
$ref: '#/components/schemas/OrderGet'
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/OrderGet'
"400":
description: An error message indicating the validation problem with the
request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"401":
description: An error message indicating the caller must pass a valid AuthToken
in the HTTP authorization request header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"500":
description: An error message indicating there was an unexpected server
error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"403":
description: An error message indicating the caller is forbidden from accessing
this page.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- bearerAuth: []
x-swagger-router-controller: Orders
/accounts/{accountId}/savedorders:
get:
tags:
- Saved Orders
summary: Get Saved Orders by Path
description: Saved orders for a specific account.
operationId: accountsAccountIdSavedordersGET
parameters:
- name: accountId
in: path
required: true
style: simple
explode: false
schema:
type: integer
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/OrderGet'
"400":
description: An error message indicating the validation problem with the
request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"401":
description: An error message indicating the caller must pass a valid AuthToken
in the HTTP authorization request header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"500":
description: An error message indicating there was an unexpected server
error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"403":
description: An error message indicating the caller is forbidden from accessing
this page.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- bearerAuth: []
x-swagger-router-controller: SavedOrders
post:
tags:
- Saved Orders
summary: Create Saved Orders
description: Save an order for a specific account. See our Place Order Samples
Guide - https://developer.tdameritrade.com/content/place-order-samples.
operationId: accountsAccountIdSavedordersPOST
parameters:
- name: accountId
in: path
required: true
style: simple
explode: false
schema:
type: integer
requestBody:
content:
application/Json:
schema:
$ref: '#/components/schemas/OrderGet'
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/OrderGet'
"400":
description: An error message indicating the validation problem with the
request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"401":
description: An error message indicating the caller must pass a valid AuthToken
in the HTTP authorization request header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"500":
description: An error message indicating there was an unexpected server
error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"403":
description: An error message indicating the caller is forbidden from accessing
this page.
content:
application/json:
schema:
$ref: '#/components/schemas/EASObject'
security:
- bearerAuth: []
x-swagger-router-controller: SavedOrders
/accounts/{accountId}/savedorders/{savedOrderId}:
get:
tags:
- Saved Orders
summary: Get Saved Orders
description: Specific saved order by its ID, for a specific account.
operationId: accountsAccountIdSavedordersSavedOrderIdGET
parameters:
- name: accountId
in: path
required: true
style: simple
explode: false
schema:
type: integer
- name: savedOrderId
in: path
required: true
style: simple
explode: false
schema:
type: integer
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/OrderGet'
"400":
description: An error message indicating the validation problem with the
request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"401":
description: An error message indicating the caller must pass a valid AuthToken
in the HTTP authorization request header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"500":
description: An error message indicating there was an unexpected server
error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"403":
description: An error message indicating the caller is forbidden from accessing
this page.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- bearerAuth: []
x-swagger-router-controller: SavedOrders
put:
tags:
- Saved Orders
summary: Replace Saved Orders
description: Replace an existing saved order for an account. The existing saved
order will be replaced by the new order. see our Place Order Samples Guide
- Click here.
operationId: accountsAccountIdSavedordersSavedOrderIdPUT
parameters:
- name: accountId
in: path
required: true
style: simple
explode: false
schema:
type: integer
- name: savedOrderId
in: path
required: true
style: simple
explode: false
schema:
type: integer
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OrderGet'
responses:
"200":
description: OK
"400":
description: An error message indicating the validation problem with the
request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"401":
description: An error message indicating the caller must pass a valid AuthToken
in the HTTP authorization request header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"500":
description: An error message indicating there was an unexpected server
error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"403":
description: An error message indicating the caller is forbidden from accessing
this page.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"404":
description: An error message if the order was not found.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- bearerAuth: []
x-swagger-router-controller: SavedOrders
delete:
tags:
- Saved Orders
summary: Delete Saved Orders
description: Delete a specific saved order for a specific account.
operationId: accountsAccountIdSavedordersSavedOrderIdDELETE
parameters:
- name: accountId
in: path
required: true
style: simple
explode: false
schema:
type: integer
- name: savedOrderId
in: path
required: true
style: simple
explode: false
schema:
type: integer
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/EASObject'
"400":
description: An error message indicating the validation problem with the
request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"401":
description: An error message indicating the caller must pass a valid AuthToken
in the HTTP authorization request header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"500":
description: An error message indicating there was an unexpected server
error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"403":
description: An error message indicating the caller is forbidden from accessing
this page.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"404":
description: An error message if the order was not found.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- bearerAuth: []
x-swagger-router-controller: SavedOrders
/accounts:
get:
tags:
- Accounts
summary: Get Accounts
description: Account balances, positions, and orders for all linked accounts.
operationId: accountsGET
parameters:
- name: fields
in: query
description: 'Balances displayed by default, additional fields can be added
here by adding positions or orders. Example: fields=positions,orders'
required: false
style: form
explode: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Account'
"400":
description: An error message indicating the validation problem with the
request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"401":
description: An error message indicating the caller must pass a valid AuthToken
in the HTTP authorization request header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"500":
description: An error message indicating there was an unexpected server
error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"403":
description: An error message indicating the caller is forbidden from accessing
this page.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"207":
description: Indicates there was a problem getting account data for one
or more linked accounts, but the accounts who's data returned successfully
is in the response. Do not aggregate balances and positions for this case.
content:
application/json:
schema:
$ref: '#/components/schemas/Account'
security:
- bearerAuth: []
x-swagger-router-controller: Accounts
/accounts/{accountId}:
get:
tags:
- Accounts
summary: Get Account
description: Account balances, positions, and orders for a specific account.
operationId: accountsAccountIdGET
parameters:
- name: accountId
in: path
required: true
style: simple
explode: false
schema:
type: integer
- name: fields
in: query
description: 'Balances displayed by default, additional fields can be added
here by adding positions or orders. Example: fields=positions,orders'
required: false
style: form
explode: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Account'
"400":
description: An error message indicating the validation problem with the
request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"401":
description: An error message indicating the caller must pass a valid AuthToken
in the HTTP authorization request header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"500":
description: An error message indicating there was an unexpected server
error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"403":
description: An error message indicating the caller is forbidden from accessing
this page.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- bearerAuth: []
x-swagger-router-controller: Accounts
/marketdata/hours:
get:
tags:
- Market Hours
summary: Get Hours for Multiple Markets
operationId: marketdataHoursGET
parameters:
- name: apiKey
in: query
required: false
style: form
explode: true
schema:
type: string
- name: markets
in: query
required: false
style: form
explode: true
schema:
type: string
enum:
- EQUITY
- OPTION
- FUTURE
- BOND
- FOREX
- name: date
in: query
required: false
style: form
explode: true
schema:
type: string
format: date-time
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Hours'
"401":
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"403":
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"404":
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- bearerAuth: []
x-swagger-router-controller: MarketHours
/marketdata/{market}/hours:
get:
tags:
- Market Hours
summary: Get Hours for Multiple Markets
operationId: marketdataMarketHoursGET
parameters:
- name: apiKey
in: query
required: false
style: form
explode: true
schema:
type: string
- name: market
in: path
required: true
style: simple
explode: false
schema:
type: string
- name: date
in: query
required: false
style: form
explode: true
schema:
type: string
format: date-time
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Hours'
"401":
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"403":
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"404":
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- bearerAuth: []
x-swagger-router-controller: MarketHours
/marketdata/{index}/movers:
get:
tags:
- Movers
summary: Get price history for a symbol
operationId: marketdataIndexMoversGET
parameters:
- name: index
in: path
required: true
style: simple
explode: false
schema:
type: string
- name: apikey
in: query
required: false
style: form
explode: true
schema:
type: string
- name: direction
in: query
required: false
style: form
explode: true
schema:
type: string
enum:
- up
- down
- name: change
in: query
required: false
style: form
explode: true
schema:
type: string
enum:
- value
- percent
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Mover'
"400":
description: An error message indicating the caller must pass a correct
value in the parameter.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"401":
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"403":
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"404":
description: An error message indicating movers for the instrument was not
found.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- bearerAuth: []
x-swagger-router-controller: Movers
/marketdata/{symbol}/pricehistory:
get:
tags:
- Price History
summary: Get price history for a symbol
operationId: marketdataSymbolPricehistoryGET
parameters:
- name: symbol
in: path
required: true
style: simple
explode: false
schema:
type: string
- name: apikey
in: query
required: false
style: form
explode: true
schema:
type: string
- name: periodType
in: query
required: false
style: form
explode: true
schema:
$ref: '#/components/schemas/PeriodType'
- name: period
in: query
required: false
style: form
explode: true
schema:
type: integer
- name: frequencyType
in: query
required: false
style: form
explode: true
schema:
$ref: '#/components/schemas/FrequencyType'
- name: frequency
in: query
required: false
style: form
explode: true
schema:
type: integer
- name: endDate
in: query
required: false
style: form
explode: true
schema:
type: integer
- name: startDate
in: query
required: false
style: form
explode: true
schema:
type: integer
- name: needExtendedHoursData
in: query
required: false
style: form
explode: true
schema:
type: boolean
default: true
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CandleList'
"401":
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"403":
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"404":
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- bearerAuth: []
x-swagger-router-controller: PriceHistory
/marketdata/quotes:
get:
tags:
- Quotes
summary: Get Quotes
description: Get quote for one or more symbols
operationId: marketdataQuotesGET
parameters:
- name: apikey
in: query
required: false
style: form
explode: true
schema:
type: string
- name: symbol
in: query
required: false
style: form
explode: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GetQuoteResponse'
"400":
description: An error message indicating the caller must pass a non null
value in the parameter.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"401":
description: An error message indicating the caller must pass a valid Authorization
in the HTTP authorization request header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"403":
description: An error message indicating the caller is forbidden from accessing
this page.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"404":
description: An error message indicating the instrument for the symbol/cusip
was not found.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"406":
description: An error message indicating an issue in the symbol regex, or
number of symbols searched is over the maximum.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- bearerAuth: []
x-swagger-router-controller: Quotes
/marketdata/{symbol}/quotes:
get:
tags:
- Quotes
summary: Get Quote
description: Get quote for a symbol
operationId: marketdataSymbolQuotesGET
parameters:
- name: symbol
in: path
required: true
style: simple
explode: false
schema:
type: string
- name: apikey
in: query
required: false
style: form
explode: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GetQuoteResponse'
"400":
description: An error message indicating the caller must pass a non null
value in the parameter.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"401":
description: An error message indicating the caller must pass a valid Authorization
in the HTTP authorization request header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"403":
description: An error message indicating the caller is forbidden from accessing
this page.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"404":
description: An error message indicating the instrument for the symbol/cusip
was not found.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- bearerAuth: []
x-swagger-router-controller: Quotes
/marketdata/chains:
get:
tags:
- Option Chains
summary: Get Option Chain
description: Get option chain for an optionable Symbol
operationId: marketdataChainsGET
parameters:
- name: apikey
in: query
description: Pass your OAuth User ID to make an unauthenticated request for
delayed data.
required: false
style: form
explode: true
schema:
type: string
- name: symbol
in: query
description: Enter one symbol
required: false
style: form
explode: true
schema:
type: string
- name: contractType
in: query
description: Type of contracts to return in the chain. Can be CALL, PUT, or
ALL. Default is ALL.
required: false
style: form
explode: true
schema:
type: string
default: ALL
enum:
- CALL
- PUT
- ALL
- name: strikeCount
in: query
description: The number of strikes to return above and below the at-the-money
price.
required: false
style: form
explode: true
schema:
type: integer
- name: includeQuotes
in: query
description: Include quotes for options in the option chain. Can be TRUE or
FALSE. Default is FALSE.
required: false
style: form
explode: true
schema:
type: boolean
default: false
- name: strategy
in: query
description: Passing a value returns a Strategy Chain. Possible values are
SINGLE, ANALYTICAL (allows use of the volatility, underlyingPrice, interestRate,
and daysToExpiration params to calculate theoretical values), COVERED, VERTICAL,
CALENDAR, STRANGLE, STRADDLE, BUTTERFLY, CONDOR, DIAGONAL, COLLAR, or ROLL.
Default is SINGLE.
required: false
style: form
explode: true
schema:
$ref: '#/components/schemas/Strategy'
- name: interval
in: query
description: Strike interval for spread strategy chains (see strategy param).
required: false
style: form
explode: true
schema:
type: integer
- name: strike
in: query
description: Provide a strike price to return options only at that strike
price.
required: false
style: form
explode: true
schema:
type: number
- name: range
in: query
description: 'Returns options for the given range. Possible values are: ITM:
In-the-money NTM: Near-the-money OTM: Out-of-the-money SAK: Strikes Above
Market SBK: Strikes Below Market SNK: Strikes Near Market ALL: All Strikes
Default is ALL.'
required: false
style: form
explode: true
schema:
type: string
enum:
- ITM
- NTM
- OTM
- SAK
- SBK
- SNK
- ALL
- name: fromDate
in: query
description: 'Only return expirations after this date. For strategies, expiration
refers to the nearest term expiration in the strategy. Valid ISO-8601 formats
are: yyyy-MM-dd and yyyy-MM-ddTHH:mm:ssz.'
required: false
style: form
explode: true
schema:
type: string
format: date-time
- name: toDate
in: query
description: 'Only return expirations before this date. For strategies, expiration
refers to the nearest term expiration in the strategy. Valid ISO-8601 formats
are: yyyy-MM-dd and yyyy-MM-ddTHH:mm:ssz.'
required: false
style: form
explode: true
schema:
type: string
format: date-time
- name: volatility
in: query
description: Volatility to use in calculations. Applies only to ANALYTICAL
strategy chains (see strategy param).
required: false
style: form
explode: true
schema:
type: number
- name: underlyingPrice
in: query
description: Underlying price to use in calculations. Applies only to ANALYTICAL
strategy chains (see strategy param).
required: false
style: form
explode: true
schema:
type: number
- name: interestRate
in: query
description: Interest rate to use in calculations. Applies only to ANALYTICAL
strategy chains (see strategy param).
required: false
style: form
explode: true
schema:
type: number
- name: daysToExpiration
in: query
description: Days to expiration to use in calculations. Applies only to ANALYTICAL
strategy chains (see strategy param)
required: false
style: form
explode: true
schema:
type: integer
- name: expMonth
in: query
description: 'Return only options expiring in the specified month. Month is
given in the three character format. Example: JAN Default is ALL.'
required: false
style: form
explode: true
schema:
type: string
default: ALL
- name: optionType
in: query
description: 'Type of contracts to return. Possible values are: S: Standard
contract NS: Non-standard contract ALL: All contracts Default is ALL.'
required: false
style: form
explode: true
schema:
type: string
default: ALL
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GetOptionChainResponse'
"400":
description: An error message indicating the caller must pass a non null
value in the parameter.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"401":
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"403":
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"404":
description: An error message indicating the optionchain for the symbol
was not found.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"500":
description: An error message indicating internal error in the service.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- bearerAuth: []
x-swagger-router-controller: OptionChains
/accounts/{accountId}/preferences:
get:
tags:
- User Info & Preferences
summary: Get Preferences
description: Preferences for a specific account.
operationId: accountsAccountIdPreferencesGET
parameters:
- name: accountId
in: path
required: true
style: simple
explode: false
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Preferences'
"400":
description: An error message indicating the validation problem with the
request.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"401":
description: An error message indicating the caller must pass a valid Authorization
in the HTTP authorization request header.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"500":
description: An error message indicating there was an unexpected server
error.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
"503":
description: An error message indicating there is a temporary problem responding.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorObject'
security:
- bearerAuth: []
x-swagger-router-controller: UserInfoPreferences
put:
tags:
- User Info & Preferences
summary: Update Preferences
description: Update preferences for a specific account. Please note that the
directOptionsRouting and directEquityRouting values cannot be modified via
this operation.
operationId: accountsAccountIdPreferencesPUT
parameters:
- name: accountId
in: path