Skip to content

how to get dates #19

Answered by alvarobartt
andresrogers asked this question in Q&A
Oct 7, 2022 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

Hi, @andresrogers can you please try the latest investiny release?

Install it as pip install investiny==0.5.0 and then run the following curated version of your code:

from investiny import historical_data
from datetime import datetime

data = historical_data(investing_id=8830, from_date="04/27/2000", to_date=datetime.today().strftime("%m/%d/%Y"))
print(data) # Python dictionary that contains the keys: date, open, high, low, close, and volume

Hope this helps! I've tested it on my own and it works fine 🤗

P.S. note that you're formatting the current date as %d/%m/%Y while investiny's date should be formatted as %m/%d/%Y.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by alvarobartt
Comment options

You must be logged in to vote
2 replies
@alvarobartt
Comment options

@varshasahasrabuddhe
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants