For most of our examples, we will use a dataset called daily_bars which contains US Equity daily bar data (Open High Low Close Volume plus some extra data). The examples will be pulling daily data but you can specify to the minute, down to the second, down to the nanosecond.
Pull daily bars for AAPL for the one month
today = '2024-06-20'
oneMonthAgo = '2024-05-20'
dataset = 'daily_bars'
mySymbols = 'AAPL' # This can be a single symbol or a list of symbols or None (to get all symbols)
query = liberator.query( name = dataset ,symbols = mySymbol , as_of = today, back_to = oneMonthAgo )
df = liberator.get_dataframe(query)
So you should be able to work out what that is doing line by line, the nice thing is, Python allows us to collapse that all down into one line! One line of code to pull one month of data…
df = liberator.get_dataframe(liberator.query( name = 'daily_bars', symbols = 'AAPL', as_of ='2024-06-20', back_to = '2024-05-20'))
This will produce a pandas dataframe something like this…