Function Name: get_timeseries(symbols, fields, granularity, start_date, end_date, timeline='', timeref='', intradayfilter='')

Description:

Retrieves historical or intraday time series data for one or more financial instruments based on selected fields, time window, and frequency. Returns a structured table with timestamps and field values grouped by symbol.

Function Signature:

get_timeseries(symbols: List[str], fields: Union[str, List[str]], granularity: str,
               start_date: str, end_date: str, timeline: str = '',
               timeref: str = '', intradayfilter: str = '') -> tuple
Parameters:
Name Type Required Default Description
symbols List[str] Yes List of instrument symbols (e.g., ['BRN 1!-ICE']).
fields str or List[str] Yes One or more fields to retrieve (e.g., 'last' or ['last','volume']). Case-insensitive.
granularity str Yes Frequency: 'D'=Daily, 'W'=Weekly, 'M'=Monthly, 'I1'=1 Min, 'I30'=30 Min, 'I60'=1 Hour.
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.
timeline str No '' Optional custom timeline (typically for internal use).
timeref str No '' Optional time reference for alignment (e.g., exchange open time).
intradayfilter str No '' Time filter for intraday data in 'HH:MM-HH:MM' format. Limits output rows to this window.
Return:

Returns a tuple of tuples (a structured time series table), where:

  • The first tuple is the header row. The first column is the datetime (labeled 'Time'); remaining columns follow the format SYMBOL.FIELD (e.g., BRN 1!-ICE.Last).
  • Each following tuple is one time step with its values.

Output Sorting Behavior: If multiple fields are requested, columns are grouped so all fields for one symbol are placed together — e.g., Time, BRN 1!-ICE.Last, BRN 1!-ICE.Volume.

Important Notes:

  • Ensure fields and granularity are valid for the selected instruments.
  • Returns may be empty for non-trading hours or holidays.
  • Unlike get_quotes(), this function does not use subscriptions.
  • Use ISO 8601 format for date and time (e.g., '2024-01-01T09:30').