Finnhub-Stock-API / finnhub-python

Finnhub Python API Client. Finnhub API provides institutional-grade financial data to investors, fintech startups and investment firms. We support real-time stock price, global fundamentals, global ETFs holdings and alternative data. https://finnhub.io/docs/api
https://finnhub.io/
Apache License 2.0
585 stars 101 forks source link

Date Format #21

Closed Sinansi closed 4 years ago

Sinansi commented 4 years ago

Hello,

For the following example, how did you format the dates in the 'from' 'to' arguments like this?

Stock candles

res = finnhub_client.stock_candles('AAPL', 'D', 1590988249, 1591852249) print(res)

Thank you!

aditya08 commented 4 years ago

the 'from' and 'to' arguments are in UNIX timestamp format.

For example, you can use the Python datetime package to generate UNIX timestamps: from datetime import datetime timestamp = datetime.timestamp(datetime.now()) print(timestamp)

Sinansi commented 4 years ago

Thank you!