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

integration quantconnect Feature Image
featured

Integration: QuantConnect

We are excited to announce our integration with QuantConnect! This offering empowers users with state-of-the-art research, backtesting, parameter optimization, and live trading capabilities, all fueled by the robust market data APIs and WebSocket Streams of Polygon.io.