I am trying to retreiving historical daily data from an API that requires the start date and current date, in Epoch Unix timestamp format. The API requires this:
data = client.get_historical_data('A-B', '1day', startDate, endDate)
The endDate
has to be now (the moment I run the script) and the startDate
has to be x-months before the endDate
.
I am definitely not a pro in Python, the script works but I need help to understand how to declare the endDate
and startDate
variables correctly using Epoch Unix timestamp, so that I can retrieve the data of the specific period I need.
Many thanks in advance!