• Invest: 1-855-880-2559
  • Open 24/7

Ally Invest API

GET/POST market/ext/quotes{.format}

Description

This call will return quotes for a symbol or list of symbols passed as a query parameter (see query parameters below). While this request type is GET, POST can also be used and is recommended for larger lists of symbols.

Authentication Required
Yes OAuth 1.0a
URI Parameters
format a response format, default is xml (See Response Structure)
Query Parameters
symbols a single symbol or list of comma-delimited symbols (required)
fids a comma-delimited list of data fields (i.e. fids=ask,bid,vol). The fids parameter should be used when a customized list of fields is desired. By default, all applicable data fields are returned.
Example URL
https://api.tradeking.com/v1/market/ext/quotes.xml

Special Considerations

For option symbols, the symbology needs to follow that of the OCC. This format is up to 21 characters that represents the contract specifications of a particular option. The following components are used in constructing the symbol:

Option Symbol Format

  • (1) - Underlying symbol
  • (2) – 2 digit expiration year
  • (3) – 2 digit expiration month
  • (4) – 2 digit expiration day
  • (5) – "C" for Call or "P" for Put
  • (6) – 8 digit strike price

Notice the strike price is represented in 8 digits no matter what the number of digits of the actual strike price. The strike price is carried to 3 decimal places, but no decimal is used within the symbol. For example, the $200 strike for the IBM option above is represented as "00200000". Also, note the two "0's padded on the front to complete the 8-digit total.

Data Fields

Data Tag Asset Types Data Description
adp_100 Stock, Average Daily Price - 100 day
adp_200 Stock, Average Daily Price - 200 day
adp_50 Stock, Average Daily Price - 50 day
adv_21 Stock, Average Daily Volume - 21 day
adv_30 Stock, Average Daily Volume - 30 day
adv_90 Stock, Average Daily Volume - 90 day
ask Stock, Option Ask price
ask_time Stock, Option Time of latest ask
asksz Stock, Option Size of latest ask (in 100's)
basis Stock, Option Reported precision (quotation decimal places)
beta Stock, Beta volatility measure
bid Stock, Option Bid price
bid_time Stock, Option Time of latest bid
bidsz Stock, Option Size of latest bid (in 100's)
bidtick Stock, Tick direction since last bid
chg Stock, Option Change since prior day close (cl)
chg_sign Stock, Option Change sign (e, u, d) as even, up, down
chg_t Stock, Option change in text format
cl Stock, Option previous close
contract_size Option, contract size for option
cusip Stock, Cusip
date Stock, Option Trade date of last trade
datetime Stock, Option Date and time
days_to_expiration Option, Days until option expiration date
div Stock, Latest announced cash dividend
divexdate Stock, Ex-dividend date of div(YYYYMMDD)
divfreq Stock, Dividend frequency, A - Annual Dividend, S - Semi Annual Dividend, Q - Quarterly Dividend, M - Monthly Dividend, N - Not applicable or No Set Dividend Frequency.
divpaydt Stock, Dividend pay date of last announced div
dollar_value Stock, Option Total dollar value of shares traded today
eps Stock, Earnings per share
exch Stock, Option exchange code
exch_desc Stock, Option exchange description
hi Stock, Option High Trade Price for the trading day
iad Stock, Indicated annual dividend
idelta Option, Option risk measure of delta using implied volatility
igamma Option, Option risk measure of gamma using implied volatility
imp_volatility Option, Implied volatility of option price based current stock price
incr_vl Stock, Option Volume of last trade
irho Option, Option risk measure of rho using implied volatility
issue_desc Option, Issue description
itheta Option, Option risk measure of theta using implied volatility
ivega Option, Option risk measure of vega using implied volatility
last Stock, Option Last trade price
lo Stock, Option Low Trade Price for the trading day
name Stock, Option Company name
op_delivery Option, Option Settlement Designation – S Std N – Non Std X - NA
op_flag Stock, Security has options (1=Yes, 0=No).
op_style Option, Option Style – values are “A” American and “E” European
op_subclass Option, Option class (0=Standard, 1=Leap, 3=Short Term)
openinterest Option, Open interest of option contract
opn Stock, Option Open trade price
opt_val Option, Estimated Option Value – via Ju/Zhong or Black-Scholes
pchg Stock, Option percentage change from prior day close
pchg_sign Stock, Option prchg sign (e, u, d) as even, up, down
pcls Stock, Option Prior day close
pe Stock, Price earnings ratio
phi Stock, Option Prior day high value
plo Stock, Option Prior day low value
popn Stock, Option Prior day open
pr_adp_100 Stock, Prior Average Daily Price "100"trade days
pr_adp_200 Stock, Prior Average Daily Price "200"trade days
pr_adp_50 Stock, Prior Average Daily Price "50"trade days
pr_date Stock, Option Trade Date of Prior Last
pr_openinterest Option, Prior day's open interest
prbook Stock, Book Value Price
prchg Stock, Option Prior day change
prem_mult Option, Option premium multiplier
put_call Option, Option type (Put or Call)
pvol Stock, Option Prior day total volume
qcond Option, Condition code of quote
rootsymbol Option, Option root symbol
secclass Stock, Option Security class (0=stock, 1=option)
sesn Stock, Option Trading session as (pre, regular, &amp, post)
sho Stock, Shares Outstanding
strikeprice Option, Option strike price (not extended by multiplier)
symbol Stock, Option Symbol from data provider
tcond Stock, Option Trade condition code – (H) halted or (R) resumed
timestamp Stock, Option Timestamp
tr_num Stock, Option Number of trades since market open
tradetick Stock, Option Tick direction from prior trade – (e,u,d) even, up, down)
trend Stock, Option Trend based on 10 prior ticks (e,u,d) even, up, down
under_cusip Option, An option's underlying cusip
undersymbol Option, An option's underlying symbol
vl Stock, Option Cumulative volume
volatility12 Stock, one year volatility measure
vwap Stock, Option Volume weighted average price
wk52hi Stock, Option 52 week high
wk52hidate Stock, Option 52 week high date
wk52lo Stock, Option 52 week low
wk52lodate Stock, Option 52 week low date
xdate Option, Expiration date of option in the format of (YYYYMMDD)
xday Option, Expiration day of option
xmonth Option, Expiration month of option
xyear Option, Expiration year of option
yield Stock, Dividend yield as %

Request Example

GET /v1/market/ext/quotes.xml?symbols=aapl HTTP/1.1
Authorization: OAuth
  oauth_consumer_key="672e71387c0a126f4e13296ecfb2b7bc",
  oauth_nonce="cfdb7f42de425d94fbc24c11a920c33e",
  oauth_signature="Vfm148kAgBZ6azEHqds43aY2UsEg3D",
  oauth_signature_method="HMAC-SHA1",
  oauth_timestamp="1306871932",
  oauth_token="819682555b63ab8bd90a4138138e7365",
  oauth_version="1.0"
Connection: close
Host: api.tradeking.com

Response Example

  <?xml version="1.0" encoding="UTF-8"?>
  <response id="-198e0f1:1365a4d54ee:4cbf">
  <quotes>
  <quote>
  <adp_100>455.5918</adp_100>
  <adp_200>417.8905</adp_200>
  <adp_50>512.5460</adp_50>
  <adv_21>25400364</adv_21>
  <adv_30>25176167</adv_30>
  <adv_90>18618981</adv_90>
  <ask>614.0100</ask>
  <ask_time>13:35</ask_time>
  <asksz>2</asksz>
  <basis>4</basis>
  <beta>1.069</beta>
  <bid>613.8300</bid>
  <bid_time>13:35</bid_time>
  <bidsz>3</bidsz>
  <bidtick>3</bidtick>
  <chg>0.5800</chg>
  <chg_sign>d</chg_sign>
  <chg_t>0.5800</chg_t>
  <cl>614.4800</cl>
  <cusip>03783310</cusip>
  <date>2012-03-28</date>
  <datetime>2012-03-28T13:35:00-04:00</datetime>
  <div>0.120000</div>
  <divexdate>19951121</divexdate>
  <divpaydt>19951215</divpaydt>
  <dollar_value>10170660652</dollar_value>
  <eps>35.11</eps>
  <exch>NASD</exch>
  <exch_desc>NASDAQ</exch_desc>
  <hi>621.4500</hi>
  <iad>0</iad>
  <incr_vl>100</incr_vl>
  <last>613.9000</last>
  <lo>610.3100</lo>
  <name>APPLE INC</name>
  <op_flag>0</op_flag>
  <opn>618.3800</opn>
  <pchg>0.094 %</pchg>
  <pchg_sign>u</pchg_sign>
  <pcls>614.4800</pcls>
  <pe>17.49</pe>
  <phi>616.2800</phi>
  <plo>606.0600</plo>
  <popn>606.1800</popn>
  <pr_adp_100>453.3548</pr_adp_100>
  <pr_adp_200>416.3485</pr_adp_200>
  <pr_adp_50>510.4657</pr_adp_50>
  <pr_date>2012-03-27</pr_date>
  <prbook>6.360</prbook>
  <prchg>7.5000</prchg>
  <pvol>21683163</pvol>
  <secclass>0</secclass>
  <sesn>regular</sesn>
  <sho>932,370,000</sho>
  <symbol>AAPL</symbol>
  <tcond>R</tcond>
  <timestamp>1332956100</timestamp>
  <tr_num>98612</tr_num>
  <tradetick>u</tradetick>
  <trend>deeueeeudu</trend>
  <vl>17038975</vl>
  <volatility12>0.264278</volatility12>
  <vwap>618.0477</vwap>
  <wk52hi>621.4500</wk52hi>
  <wk52hidate>20120328</wk52hidate>
  <wk52lo>310.5000</wk52lo>
  <wk52lodate>20110620</wk52lodate>
  </quote>
  </quotes>
  </response>
Disclaimer:

Any mention of actual symbols are to be used for coding purposes only and do not imply a recommendation or solicitation to buy or sell a particular security or to engage in any particular investment strategy.

At the time of publication and in the preceding month, Ally Invest did not have ownership greater than 1% in any stocks mentioned here and does not have any other actual, material conflict of interest known at the time of publication.

Ally Invest did not receive compensation from a public offering or from investment banking services related to any companies mentioned here within the past 12 months, or expects to receive any in the next 3 months. Ally Invest did not engage in market making in the securities mentioned here.

Ally Invest Securities' background can be found at FINRA's BrokerCheck. Options involve risk and are not suitable for all investors.

Review the Characteristics and Risks of Standardized Options brochure (PDF) before you begin trading options. Options investors may lose the entire amount of their investment in a relatively short period of time.