Introducing

Schema Updates

Jan 21, 2018

We are updating the schemas of the TRADES and QUOTES real-time data feeds. All other real-time feeds, and APIs will stay as they are currently.

We are changing the schema of the trades/quotes for smaller and only unique per tick data attributes. This will make the messages smaller, enabling less bandwidth and less processing per tick for encoding/decoding the JSON.

New schema ticks will start streaming on market open, Monday, January 29th.

Current Trade Schema:

{
	sym: 'MSFT',		// Symbol
	symT: 83,		// Symbol Type
	xT: 32, 		// Symbol Exchange Type
	x: 90, 			// Trade Exchange
	cT: 83, 		// Symbol Country Type
	pc: 2, 			// Price Precision ( 2 decimals )
	p: 58.02,		// Trade Price
	s: 1,			// Trade Size ( Volume )
	t: 1342314		// Timestamp
	c1: 0			// Trade Condition 1 ( optional )
	c2: 0			// Trade Condition 2 ( optional )
	c3: 0			// Trade Condition 3 ( optional )
	c4: 0			// Trade Condition 4 ( optional )
}

Updated Trade Schema

{
	sym: "MSFT",		// Symbol
	x: 90,			// Exchange ID
	p: 58.02,		// Trade Price
	s: 1,			// Trade Size ( volume )
	t: 1342314		// Timestamp ( Unix, ms precision )
	c: [1,2]		// Trade Conditions array
}

Current Quote Schema

{
	sym: 'MSFT',		// Symbol
	symT: 83,		// Symbol Type
	c: 0			// Quote Condition
	bX: 32,			// Bid Exchange
	aX: 83,			// Ask Exchange
	bPc: 2,			// Bid Price Precision
	bP: 57.90,		// Bid Price
	aPc: 2,			// Ask Price Precision
	aP: 58.02,		// Ask Price
	bS: 1,			// Bid Size
	aS: 1,			// Ask Size
	t: 1342314		// Timestamp
}

Updated Quote Schema

{
	sym: "MSFT",		// Symbol
	c: 0,			// Condition, if any
	bx: 32,			// Bid Exchange ID
	ax: 83,			// Ask Exchange ID
	bp: 57.90,		// Bid Price
	ap: 58.02,		// Ask Price
	bs: 1,			// Bid Size
	as: 1,			// Ask Size
	t: 1342314		// Timestamp ( Unix, ms precision )
}

As you can see the schemas are much more concise. Almost all of the important key/values have been kept the same. Any attributes removed ( eg: symbol exchange ) can be resolved by querying the symbol from the API.

We do not expect to make changes to the schema again in the foreseeable future. We apologize for any inconvenience.

From the blog

See what's happening at polygon.io

polygon plugin for chatgpt Feature Image
announcement

Announcing the Polygon ChatGPT Plugin

Introducing the Polygon plugin for ChatGPT, a powerful tool that simplifies financial research by providing easy access to real-time and historical market data for Stocks, Options, Indices, Forex, and Crypto.

Team Polygon Profile Photo

editor

Team Polygon

indices data has arrived Feature Image
announcement

Indices Data Has Arrived

We are excited to announce the launch of the Indices API endpoints, offering real-time and historical market data for over 11,400+ Indices, including the S&P 500, Dow Jones Industrial Average, Nasdaq-100, and the VIX. With access to comprehensive market data, businesses and individual investors can make informed decisions in today's rapidly evolving financial markets. We have brought the same low-latency and developer-centric API design of our

Team Polygon Profile Photo

editor

Team Polygon