Barchart Market Data Solutions » Web Services » Historical Data
Minute Queries
Minute queries return all minute 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
Minute Queries
Minute queries return all minute 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 minute queries is queryminutes.ashx.
An optional interval can be specified in order to aggregate sets of contiguous minute records (the number of minute records in each set is equal to the specified interval) into one record. If the interval is omitted, then a 1 minute interval (no aggregation) will be the default.
If both a start and an end date/time are specified, then all minutes within the specified period will be returned. If a maximum number of records is specified along with both date/times and the number of minute 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, excess records will be cut off from the chronological beginning; otherwise).
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 available minute data will be returned, whichever is smaller. If no maximum number of records is specified, then all the minute 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 minute records up to the maximum number specified or up to the most current minute record available will be returned, whichever is smaller. If no maximum number of records is specified, then all the minute records between the start date/time specified and the end of the specified start day are returned.
If no date/times and no maximum number of records 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 the start date/time is specified to the beginning of available data and the end date/time is specified to the end of available data (refer to maximum number of records when both dates are specified in paragraph above).
Trading_Day for futures contracts signifies the actual trading day used to construct the daily o/h/l/c values. For the (ES) E-Mini S&P futures Trading _Day will start at 3:30pm the previous day, and finish at 3:15pm the next day.
Historical market data reflects all trades made during all sessions of the market, including electronic trades executed for futures markets during regular holidays.
The date/times for all futures and forex contracts are always in CST. Times are adjusted for daylight savings time.
Minute Query Parameters
The following parameters are either required or supported in minute 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 available data if a maximum number of records is specified; otherwise it will default to the beginning of the day specified in the end parameter, if 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 available data, if a maximum number of records is specified; otherwise, 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, the number of records returned will be determined by the date/time parameters specified as well as any defaults that apply to the query.
interval: this parameter is the size of the interval to be used when aggregating records. If not specified, the default will be set to 1 and no aggregation will be performed.
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.
splits: this parameter only applies to stocks and specifies whether the data returned should be adjusted for splits or not. Set to true to query for adjusted the data, or to false for non-adjusted data. If not specified, the default at this time is true, but there is no guarantee that this won’t change in the future. In order to guarantee the same adjustment settings in the future, this parameter should be specified.
dividends: this parameter only applies to stocks and specifies whether the data returned should be adjusted for dividends or not. Set to true to query for adjusted the data, or to false for non-adjusted data. If not specified, the default at this time is false, but there is no guarantee that this won’t change in the future. In order to guarantee the same adjustment settings in the future, this parameter should be specified.
Note: all times are in Eastern Time for equities and Central Time for everything else.
Minute Query Results Format
Results are returned by minute queries in comma delimited text format, one minute record per line, as follows:
YYYY-MM-DD HH:MM,TRADING_DAY,OPEN,HIGH,LOW,CLOSE,VOLUME
Example:
2009-02-03 14:44,10,821.75,823.25,820.75,823,10279
2009-02-03 14:43,10,823.25,823.75,821.75,821.75,11888
Minute Query Examples
In order to query all the minute records for Apple between 9 am and 12 pm on February 3, 2009, execute:
http://ds01.ddfplus.com/historical/queryminutes.ashx?username=username&password=password&symbol=AAPL&start=200902030900&end=200902031200
In order to query the last 1000 minute records for Apple for the current day in descending order, execute:
http://ds01.ddfplus.com/historical/queryminutes.ashx?username=username&password=password&symbol=AAPL&maxrecords=1000&order=desc
In order to query the first 1000 minute records for Apple for the February 3, 2009, in ascending order, execute:
http://ds01.ddfplus.com/historical/queryminutes.ashx?username=username&password=password&symbol=AAPL&start=20090203&maxrecords=1000&order=asc
In order to query 5-minute interval records for Apple between 9 am and 12 pm on February 3, 2009, execute:
http://ds01.ddfplus.com/historical/queryminutes.ashx?username=username&password=password&symbol=AAPL&start=200902030900&end=200902031200&interval=5