Build Your Own:

get_timeseries() pulls a history of values for your symbols over a date range at a chosen frequency. Build one step by step:

Step 1 — Import the library

import icepython as ice

Step 2 — Identify your symbols. Here, Brent Crude front-month:

symbols = ['BRN 1!-ICE']

Step 3 — Choose your fields:

fields = ['Last', 'Volume']

Step 4 — Select granularity (one value): 'D' Daily, 'W' Weekly, 'M' Monthly, 'I1' 1-min, 'I30' 30-min, 'I60' 1-hour:

granularity = 'D'

Step 5 — Define your date range (ISO date or datetime):

start_date = '2024-01-01'
end_date   = '2024-01-31'

Step 6 — (Optional) Add an intraday time filter. Only meaningful for intraday granularities; limits rows to a window:

# intradayfilter = '09:30-16:00'

Step 7 — Make the request and loop the output. The result is a tuple of tuples, so iterate to print each row:

data = ice.get_timeseries(symbols, fields, granularity, start_date, end_date)
for row in data:
    print(row)

Output:

('Time', 'BRN 1!-ICE.Last', 'BRN 1!-ICE.Volume')
('2024-01-02', 70.3, 8.0)
('2024-01-03', 71.61, 0.0)
('2024-01-04', 70.95, 100.0)
('2024-01-05', 71.4, 0.0)
('2024-01-08', 70.21, 0.0)
('2024-01-09', 70.63, 0.0)
('2024-01-10', 70.3, 21.0)
('2024-01-11', 70.76, 107.0)
('2024-01-12', 71.61, 230.0)
('2024-01-15', 71.37, 0.0)
('2024-01-16', 71.19, 10.0)
('2024-01-17', 70.98, 101.0)
('2024-01-18', 71.5, 0.0)
('2024-01-19', 71.03, 0.0)
('2024-01-22', 72.11, 2.0)
('2024-01-23', 71.96, 0.0)
('2024-01-24', 72.2, 0.0)
('2024-01-25', 73.03, 0.0)
('2024-01-26', 73.67, 0.0)
('2024-01-29', 72.87, 50.0)
('2024-01-30', 73.45, 16.0)
('2024-01-31', 72.4, 0.0)