Documentation

Get market events

Stream market updates (realtime or delayed) using HTTP streaming. You will receive a different payload depending on the market event that occurred. See details about each events data.

Note: In order to stream data, you must first create a streaming session. Upon receiving a sessionid, you will have up to 5 minutes to connect to a streaming endpoint before the session expires.

Endpoint

Method
POST
URL
/v1/markets/events

Headers

Accept
application/xml, application/json, application/javascript
Default: application/xml
Required: false
Authorization
Bearer {access token}
Required: true

Query Parameters

sessionid
The session id you received from creating the session
Required: true
symbols
A comma delimited list of symbols, both equity and option symbols are accepted.
Required: true
Example: 'symbols=AAPL,MSFT,NFLX'
filter
A comma delimited list of payload types you would like to receive. You can use this to receive data payloads of a specific type.
Required: false
Example: 'filter=quote,trade'
linebreak
A boolean on whether to include a "\n" linebreak at the end of each payload. Any value will resolve to true, omit to set false.
Required: false
Example: 'linebreak=true'

Response

Field Description
type Type of event received. One of: trade, quote, summary
symbol Symbol of the event
exch Reporting exchange's code
price Last price
size Size of the current trade
cvol Cumalative volume for the day
date Unix timestamp of the event
bid Bid
bidsz Bid size
bidexch Reporting exchange of the current bid
biddate Date of the current bid
ask Ask
asksz Ask size
askexch Reporting exchange of the current ask
askdate Date of the current ask
open Current day's open
high High
low Low
prevClose Previous day's close

Example

Command

$ curl -X POST -d "symbols=SPY&sessionid=fb469d7ef430b0baf0cab6c436e70375" https://stream.tradier.com/v1/markets/events

Request

POST /v1/markets/events HTTP/1.1
Host: stream.tradier.com
Accept: application/xml
User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5

symbols=SPY&sessionid=fb469d7ef430b0baf0cab6c436e70375

Response

HTTP/1.1 200 OK
Content-Type: application/xml;charset=utf-8

<status>connected</status>
<data>
  <type>trade</type>
  <symbol>SPY</symbol>
  <exch>Z</exch>
  <price>179.84</price>
  <size>300</size>
  <cvol>5840856</cvol>
  <date>1385131210000</date>
</data>
<data>
  <type>quote</type>
  <symbol>SPY</symbol>
  <bid>179.83</bid>
  <bidsz>559</bidsz>
  <bidexch>P</bidexch>
  <biddate>1385131210000</biddate>
  <ask>179.84</ask>
  <asksz>28</asksz>
  <askexch>Q</askexch>
  <askdate>1385131210000</askdate>
</data>
<data>
  <type>summary</type>
  <symbol>SPY</symbol>
  <open>179.98</open>
  <high>180.08</high>
  <low>179.79</low>
  <prevClose>179.91</prevClose>
</data>
<data>
  <type>timesale</type>
  <symbol>SPY</symbol>
  <exch>D</exch>
  <bid>203.94</bid>
  <ask>203.95</ask>
  <last>203.9405</last>
  <size>4</size>
  <date>1415734248495</date>
</data>

Tradier Inc. and its corresponding technology services (including API services) are distinct and separate from the services provided by Tradier Brokerage Inc. For more information regarding the services of Tradier, Inc., please contact techsupport@tradier.com. For more information regarding the services of Tradier Brokerage, Inc. please contact service@tradierbrokerage.com. Tradier Brokerage Inc. Member FINRA/SIPC

© 2017 Tradier Inc.
  • 11016 Rushmore Drive, Suite 350
  • Charlotte, NC 28277

All materials contained on this site and specifically the API documentation pages are protected by United States copyright law and may not be copied, reproduced, distributed, transmitted, displayed, published or broadcast without the prior written permission of Tradier Inc. The Structure, Format, Layout, Examples and Design of the pages are owned by Tradier Inc, and any efforts to willfully or accidently duplicate a whole or part of the pages on this site is a violation of United States copyright law.