Barchart Market Data Solutions » Web Services » Historical Data
Tick Queries
Tick queries return all tick records for a specified symbol during a specified period between a start and an end date/time.
Contact Us
Historical Data
- Overview
- Tick Queries
- Minute Queries
- Minute Date Range Queries
- Nearby Minute Queries
- Form T Minute Queries
- End of Day (EOD) Queries
- End of Day Date Range Queries
- Event Queries
Instrument Definitions
Tick Queries
Tick queries return all tick records for a specified symbol during a specified period between a start and an end date/time. A maximum number of records to be returned can also be specified, along with either the start or end date/time, or both. The request handler for tick queries is queryticks.ashx.
The result set returned from a tick query will always be confined to a single day. In other words, if ticks for different days are required, then more than one query will have to be executed in order to retrieve all the ticks.
If both a start and an end date/time are specified, then all ticks within the specified period will be returned, as long as the period is contained within a single day. If a maximum number of records is specified along with both date/times and the number of tick records between those dates exceeds the maximum number of records to be returned, then the excess records will be cut off from the beginning or the end of the result set depending on the sort order specified in the query (if ascending order is specified, excess records will be cut off from the chronological end of the result set, otherwise they will be cut off from the chronological beginning).
If no start date/time is specified and an end date/time is specified along with a maximum number of records to be returned, then a number of records up to the maximum number specified or back to the beginning of the specified end day will be returned, whichever is smaller. If no maximum number of records is specified, then all the tick records between the end date/time specified and the beginning of the specified end day will be returned.
If no end date/time is specified and a start date/time is specified along with a maximum number of records to be returned, then a number of records up to the maximum number specified or up to the end of the specified start day will be returned, whichever is smaller. If no maximum number of records is specified, then all the tick records between the start date/time specified and the end of the specified start day are returned.
If no date/times are specified, then the start date/time will default to the beginning of the current day and the end date/time will default to the beginning of the next day. If a maximum number of records is specified, the query will be treated as if both start and end date/times had been specified with their default values (refer to maximum number of records when both dates are specified in paragraph above).
Note: although query date/times can only be specified down to the second, tick timestamps are returned down to the millisecond, and several ticks can actually occur in the same millisecond, so when specifying a maximum number of ticks in a query, all ticks within a given second will be returned even if they exceed the maximum number of ticks specified.
Tick Query Parameters
The following parameters are either required or supported in tick queries (required parameters are marked with an asterisk):
username*: this parameter should be set to the user name provided by ddfplus to the user account.
password*: this parameter should be set to the password provided by ddfplus for the user name passed in parameter username.
symbol*: this parameter should be set to the symbol for which the query should return data. This query supports the '*' notation for futures (i.e. RS*1, where RS is the root symbol for the commodity). Note that a SYMBOL field containing the active contract for which data is returned will be prepended to each record in the result set when using the '*' notation.
start: this parameter should be set to the desired start date/time for the query (the result set will include records back to, and including, this value). If not set, the value will default to the beginning of the day specified in the end parameter, if end is specified, or to the beginning of the current day, if end is not specified. The value should conform to the format yyyymmdd[hhmm[ss]], where fields in brackets are optional. Any optional fields that are not explicitly set will default to 0 (i.e. 20090203 will default to 20090203000000 or February 3, 2009 at 00:00:00).
end: this parameter should be set to the desired end date/time for the query (the result set will include records up to, but not including, this value). If not set, the value will default to the end of the day specified in the start parameter, if specified, or to the end of the current day, if start is not specified. The value should conform to the format yyyymmdd[hhmm[ss]], where fields in brackets are optional. Any optional fields that are not explicitly set will default to 0 (i.e. 20090203 will default to 20090203000000 or February 3, 2009 at 00:00:00).
maxrecords: this parameter should be set to the maximum number of records desired. If not specified, there number of records returned will be determined by the date/time parameters specified as well as any defaults that apply to the query.
order: this parameter can be set to one of two values (asc and desc) in order to specify the chronological order of the result set returned. If this parameter is not specified, the order results is not guaranteed.
sessionfilter: this parameter modifies the default session codes/sale conditions used to return ticks for each exchange. For NYSE and AMEX, the default session filter is "@EFKX56V9" (meaning all ticks with sale conditions corresponding to one of the characters in the filter are included in the results), for NASDAQ the default is "@ABDEFKOSXY156", and for everything else all session codes/sale conditions are returned except the settle (session code '*'). If the session filter is set to a string of valid session codes (i.e. "EFK"), only ticks with the specified session codes are included in the results. If the string is prefixed with character '!' (i.e."!EFK"), all session codes except those in the string are included in the results. If the string is prefixed with character '+' (i.e. "+T"), then all the default session codes in addition to the ones specified in the string are included in the results. And if the string is prefixed with character '-' (i.e. "-EF") then all default session codes except the ones specified are included in the results. Please note that the '+' character should be escaped (to %2B) when entering the URL in a web browser or executing the query in an API that does not escape it by default.
Note: All times are in Eastern Time for equities and Central Time for everything else.
Tick Query Results Format
Results are returned by tick queries in comma delimited text format, one tick record per line, as follows:
YYYY-MM-DD HH:MM:SS.FFF,TRADING_DAY,SESSION_CODE,PRICE,SIZE
Example:
2009-02-03 13:30:00.000,10,G,823.5,1
2009-02-03 13:30:00.125,10,G,823.75,7
The session code (session code for futures and sale condition for equities) is a single character that is documented in the ddfplus broadcast feed specifications on the ddfplus developer website.
Tick Query Examples
In order to query all the ticks for Apple between 9 am and 12 pm on February 3, 2009, execute:
http://ds01.ddfplus.com/historical/queryticks.ashx?username=username&password=password&symbol=AAPL&start=20090203090000&end=20090203120000
In order to query the last 1000 ticks for Apple for the current day in descending order, execute:
http://ds01.ddfplus.com/historical/queryticks.ashx?username=username&password=password&symbol=AAPL&maxrecords=1000&order=desc
In order to query the first 1000 ticks for Apple for the February 3, 2009, in ascending order, execute:
http://ds01.ddfplus.com/historical/queryticks.ashx?username=username&password=password&symbol=AAPL&start=20090203&maxrecords=1000&order=asc
Trade Example
In order to query all the ticks for Apple between 9 am and 12 pm on February 3, 2009, execute:
https://historical-quotes.aws.barchart.com/historical/queryticks.ashx?username=username&password=password&type=T&symbol=AAPL&order=desc&sessionfilter=!!&maxrecords=10&sale4Condition=true&participantID=true&exchId=true
Results are returned by tick queries in comma delimited text format, one tick record per line, as follows:
YYYY-MM-DD HH:MM:SS.FFF,TRADING_DAY,EXCHANGE ID(optional),SESSION_CODE,SALE 4BYTE CONDITION(optional),PRICE,SIZE,PARTICIPANT ID(optional)
Example:
2020-12-01 11:56:33.122,1,Q,I,@ I,123.1432,3,D 2020-12-01 11:56:32.734,1,Q,I,@ I,123.145,4,D 2020-12-01 11:56:32.467,1,Q,@,@ ,123.145,100,Q 2020-12-01 11:56:32.453,1,Q,I,@ I,123.1493,5,D
Quote Example
Quote Condition is implied ‘Regular’ for the Best Bid and Best Offer. In order to query all the ticks for Apple between 9 am and 12 pm on February 3, 2009, execute:
https://historical-quotes.aws.barchart.com/historical/queryticks.ashx?username=username&password=password&type=Q&symbol=AAPL&order=desc&sessionfilter=!!&maxrecords=10&sale4Condition=true&participantID=true&exchId=true
Results are returned by tick queries in comma delimited text format, one tick record per line, as follows:
YYYY-MM-DD HH:MM:SS.FFF,TRADING_DAY,EXCHANGE ID(optional),Quote Condition,BID PRICE, BID SIZE,Bid Participant ID(optional),OFFER PRICE, OFFER SIZE,Offer Participant ID(optional)
Example:
2020-12-01 12:53:55.791,1,Q,R,122.83,100,Q,122.84,1000,N 2020-12-01 12:53:55.730,1,Q,R,122.83,100,Q,122.84,900,N
Both example: (Type='B')
exchangeID=true (defaults false) - returns the listing exchange
Q – Nasdaq
A – NYSE Arca
N – NYSE
U – OTC BB
A – NYSE Arca
N – NYSE
U – OTC BB
participantID=true (default false) - returns the Participant or Processor that initiated the trade.
Particpant ID for NYSE / NYSE Arca (cts pillar output page 64)
A – NYSE American, LLC (NYSE American)
B – NASDAQ OMX BX, Inc. (NASDAQ OMX BX)
C – NYSE National, Inc. (NYSE National)
D – FINRA Alternative Display Facility (ADF)
H – MIAX Pearl Exchange, LLC (MIAX)
I – International Securities Exchange, LLC (ISE)
J – Cboe EDGA Exchange, Inc. (Cboe EDGA)
K – Cboe EDGX Exchange, Inc. (Cboe EDGX)
L – Long-Term Stock Exchange, Inc. (LTSE)
M – NYSE Chicago, Inc. (NYSE Chicago)
N – New York Stock Exchange, LLC (NYSE)
P – NYSE Arca, Inc. (NYSE Arca)
S – Consolidated Tape System (CTS)
T – NASDAQ Stock Market, LLC (NASDAQ)
U – Members Exchange, LLC (MEMX)
V – Investors’ Exchange, LLC. (IEX)
W – CBOE Stock Exchange, Inc. (CBSX)
X – NASDAQ OMX PSX, Inc. (NASDAQ OMX PSX)
Y – Cboe BYX Exchange, Inc. (Cboe BYX)
Z – Cboe BZX Exchange, Inc. (Cboe BZX)
B – NASDAQ OMX BX, Inc. (NASDAQ OMX BX)
C – NYSE National, Inc. (NYSE National)
D – FINRA Alternative Display Facility (ADF)
H – MIAX Pearl Exchange, LLC (MIAX)
I – International Securities Exchange, LLC (ISE)
J – Cboe EDGA Exchange, Inc. (Cboe EDGA)
K – Cboe EDGX Exchange, Inc. (Cboe EDGX)
L – Long-Term Stock Exchange, Inc. (LTSE)
M – NYSE Chicago, Inc. (NYSE Chicago)
N – New York Stock Exchange, LLC (NYSE)
P – NYSE Arca, Inc. (NYSE Arca)
S – Consolidated Tape System (CTS)
T – NASDAQ Stock Market, LLC (NASDAQ)
U – Members Exchange, LLC (MEMX)
V – Investors’ Exchange, LLC. (IEX)
W – CBOE Stock Exchange, Inc. (CBSX)
X – NASDAQ OMX PSX, Inc. (NASDAQ OMX PSX)
Y – Cboe BYX Exchange, Inc. (Cboe BYX)
Z – Cboe BZX Exchange, Inc. (Cboe BZX)
Particpant ID for Nasdaq (utp binnary 1.5 page 36)
A – NYSE American, LLC
B – Nasdaq BX, Inc.
C – NYSE National, Inc.
D – Financial Industry Regulatory Authority (FINRA)
E – Market Independent
H – MIAX Pearl, LLC (MIAX)
I – Nasdaq ISE, LLC*
J – Cboe EDGA Exchange, Inc.
K – Cboe EDGX Exchange, Inc.
L – Long-Term Stock Exchange (LTSE)
M – NYSE Chicago, Inc.
N – New York Stock Exchange LLC
P – NYSE Arca, Inc.
Q – Nasdaq, Inc.
U – MEMX LLC (MEMX)
V – Investors’ Exchange LLC (IEX)
W – Cboe Exchange, Inc.
X – Nasdaq PHLX LLC
Y – Cboe BYX Exchange, Inc.
Z – Cboe BZX Exchange, Inc.
B – Nasdaq BX, Inc.
C – NYSE National, Inc.
D – Financial Industry Regulatory Authority (FINRA)
E – Market Independent
H – MIAX Pearl, LLC (MIAX)
I – Nasdaq ISE, LLC*
J – Cboe EDGA Exchange, Inc.
K – Cboe EDGX Exchange, Inc.
L – Long-Term Stock Exchange (LTSE)
M – NYSE Chicago, Inc.
N – New York Stock Exchange LLC
P – NYSE Arca, Inc.
Q – Nasdaq, Inc.
U – MEMX LLC (MEMX)
V – Investors’ Exchange LLC (IEX)
W – Cboe Exchange, Inc.
X – Nasdaq PHLX LLC
Y – Cboe BYX Exchange, Inc.
Z – Cboe BZX Exchange, Inc.
sale4Condition=true (default false) - returns the extended 4 byte sale condition associated with the trade.
Sale Condition NYSE - Denotes the sale condition associated with a trade (cts pillar output page 64)
@ – Regular Sale
B – Average Price Trade
C – Cash Trade (Same Day Clearing)
E – Automatic Execution
F – Inter-market Sweep Order
H – Price Variation Trade
I – Odd Lot Trade
K – Rule 127 (NYSE Only) or Rule 155 (NYSE American only)
L – Sold Last (Late Reporting)
M – Market Center Official Close
N – Next Day Trade (Next Day Clearing)
O – Market Center Opening Trade
P – Prior Reference Price
Q – Market Center Official Open
R – Seller
T – Extended Hours Trade
U – Extended Hours Sold (Out Of Sequence)
V – Contingent Trade
X – Cross Trade
Z – Sold (Out Of Sequence)
4 – Derivatively Priced
5 – Market Center Reopening Trade
6 – Market Center Closing Trade
7 – Qualified Contingent Trade
8 – Reserved
9 – Corrected Consolidated Close Price as per Listing Market
B – Average Price Trade
C – Cash Trade (Same Day Clearing)
E – Automatic Execution
F – Inter-market Sweep Order
H – Price Variation Trade
I – Odd Lot Trade
K – Rule 127 (NYSE Only) or Rule 155 (NYSE American only)
L – Sold Last (Late Reporting)
M – Market Center Official Close
N – Next Day Trade (Next Day Clearing)
O – Market Center Opening Trade
P – Prior Reference Price
Q – Market Center Official Open
R – Seller
T – Extended Hours Trade
U – Extended Hours Sold (Out Of Sequence)
V – Contingent Trade
X – Cross Trade
Z – Sold (Out Of Sequence)
4 – Derivatively Priced
5 – Market Center Reopening Trade
6 – Market Center Closing Trade
7 – Qualified Contingent Trade
8 – Reserved
9 – Corrected Consolidated Close Price as per Listing Market
Sale Condition Nasdaq - Denotes the sale condition associated with a trade (utp binnary 1.5 page 43)
@ – Regular Sale
A – Acquisition
B – Bunched Trade
C – Cash Sale
D – Distribution
E – Placeholder
F – Intermarket Sweep
G – Bunched Sold Trade
H – Price Variation Trade
I – Odd Lot Trade
K – Rule 155 Trade (AMEX)
L – Sold Last
M – Market Center Official Close
N – Next Day
O – Opening Prints
P – Prior Reference Price
Q – Market Center Official Open3
R – Seller
S – Split Trade
T – Form T
U – Extended trading hours (Sold Out of Sequence)
V – Contingent Trade
W – Average Price Trade
X – Cross Trade
Y – Yellow Flag Regular Trade
Z – Sold (out of sequence)
1 – Stopped Stock (Regular Trade)
4 – Derivatively priced
5 – Re-Opening Prints
6 – Closing Prints
7 – Qualified Contingent Trade
8 – Placeholder For 611 Exempt
9 – Corrected Consolidated Close (per listing market)
A – Acquisition
B – Bunched Trade
C – Cash Sale
D – Distribution
E – Placeholder
F – Intermarket Sweep
G – Bunched Sold Trade
H – Price Variation Trade
I – Odd Lot Trade
K – Rule 155 Trade (AMEX)
L – Sold Last
M – Market Center Official Close
N – Next Day
O – Opening Prints
P – Prior Reference Price
Q – Market Center Official Open3
R – Seller
S – Split Trade
T – Form T
U – Extended trading hours (Sold Out of Sequence)
V – Contingent Trade
W – Average Price Trade
X – Cross Trade
Y – Yellow Flag Regular Trade
Z – Sold (out of sequence)
1 – Stopped Stock (Regular Trade)
4 – Derivatively priced
5 – Re-Opening Prints
6 – Closing Prints
7 – Qualified Contingent Trade
8 – Placeholder For 611 Exempt
9 – Corrected Consolidated Close (per listing market)