get_timesales(symbols, fields, start_date, end_date, filter='', conditions=[], conditionslogic='')
Description:
Retrieves snapshot-level Time & Sales data for one or more symbols over a specified date/time range. This includes tick-by-tick trade records and optional condition-based filtering. Results are returned as tuples and can be easily converted into a DataFrame.
Function Signature:
get_timesales(symbols: List[str], fields: Union[str, List[str]],
start_date: str, end_date: str, filter: str = '',
conditions: List[str] = [], conditionslogic: str = '') -> tuple
Parameters:
| Name | Type | Required | Default | Description |
| symbols | List[str] | Yes | — | List of instrument symbols. Max 10 symbols per request. |
| fields | str or List[str] | Yes | — | One or more fields to return (e.g., ['Price', 'Conditions']). |
| start_date | str | Yes | — | Start date or datetime in ISO format (e.g., '2024-01-01' or '2024-01-01T09:00'). |
| end_date | str | Yes | — | End date or datetime in ISO format. |
| filter | str | No | '' | Optional data filter. Use get_search_filters() to view available options. |
| conditions | List[str] | No | [] | List of conditions to apply (e.g., ['BlockTrde', 'Leg']). Use get_conditions() to list valid values. |
| conditionslogic | str | No | '' | Logical operator applied to the conditions list (e.g., 'AND', 'OR'). |
Default Behavior & Internals:
- Data is returned in a tuple with date and time in the left-most column; symbols and fields appear in the column headers to the right.
- If multiple fields are requested, the output is sorted so all fields for one symbol are placed together.
- Easily converted into a pandas DataFrame with pd.DataFrame(list(data)).
Notes:
- Time & Sales requests are limited to 1 per second.
- Time & Sales requests are limited to 10 symbols per request.
- Use ISO 8601 format for date and time.