Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0_API_alphavantage_get_old_history.py not working since alphavantage API url changed and non of this files are working #21

Open
datacrud8 opened this issue Aug 1, 2023 · 8 comments

Comments

@datacrud8
Copy link

datacrud8 commented Aug 1, 2023

0_API_alphavantage_get_old_history.py not working since alphavantage API url changed and non of this files are working.
If possible please rebuild this excellent project and upload the new version please. Also install failed with mitmproxy.

when I put print column: the data looks like
[' "1. Information": "Intraday (15min) open', ' high', ' low', ' close prices and volume"', 'Unnamed: 4']

but actually code having something different

Traceback (most recent call last):
File "0_API_alphavantage_get_old_history.py", line 107, in
df_S_all = df_S_all.sort_values(['Date'], ascending=True)

raise KeyError(key)

KeyError: 'Date'

@Leci37
Copy link
Owner

Leci37 commented Aug 1, 2023

looks easy to fix
they are change the way to requests https://www.alphavantage.co/documentation/#intraday

Old system (recenly in the code 08-2023 )
https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY_EXTENDED&symbol=UBER&interval=15min&slice=year2month12&apikey=FXZ0

New system (have to be uptaded I dont have time )
https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=IBM&interval=5min&month=2019-01&outputsize=full&apikey=FXZ0

alphavantage has changed the keywords request &slice=year2month12 for &month=2019-01

Please try to change it , if work , could you share it to updated the code

@datacrud8
Copy link
Author

datacrud8 commented Aug 1, 2023

did all changes but no, this is not working: see this is the api response: meta data tag making issue.
0_API_alphavantage_get_old_history.py this file must be changed based on current meta data . please check your code, commit the new changes.

"Meta Data": {
"1. Information": "Intraday (5min) open, high, low, close prices and volume",
"2. Symbol": "IBM",
"3. Last Refreshed": "2019-01-31 19:15:00",
"4. Interval": "5min",
"5. Output Size": "Full size",
"6. Time Zone": "US/Eastern"
},
"Time Series (5min)": {
"2019-01-31 19:15:00": {
"1. open": "103.2400",
"2. high": "103.3990",
"3. low": "102.9970",
"4. close": "103.1370",
"5. volume": "320"
},
"201

@datacrud8
Copy link
Author

when I print the clumn names: its showing like this :

[' "1. Information": "Intraday (15min) open', ' high', ' low', ' close prices and volume"', 'Unnamed: 4']

but in the code : column names not matched with waht data received from alphavantage
df_S_all = df_S_all.rename(columns={'time': 'Date', 'open': 'Open','high': 'High', 'close': 'Close','low': 'Low', 'volume': 'Volume'})
df_S_all = df_S_all.sort_values(['Date'], ascending=True)

better can you please build the project code and see the error in your local machine.

@Leci37
Copy link
Owner

Leci37 commented Aug 2, 2023

when I print the clumn names: its showing like this :

[' "1. Information": "Intraday (15min) open', ' high', ' low', ' close prices and volume"', 'Unnamed: 4']

likely your are reciving a dict, you have to look inside the dict to only get Open, close..... data

@datacrud8
Copy link
Author

Yes thats correct , trying to take time series data contained those but its not taking out: below is the yellow marked we need to process it.
1Capture

tried with multiple way but its not working, Can you please able to update code base. also can you please provide your contact email address, so that I can show you how to progress this.

@Leci37
Copy link
Owner

Leci37 commented Aug 7, 2023

If I may, could you make the change?

It's easy,
1º change the type of query , (explained in previous answers )
2º process and modify the data for a correct visualisation with pandas.
3º save them in a .csv following the format of the previous one.
4º [if you want to ] pass me the solution to update the source code

excuse me, if you are stuck with this, I don't think you have much progress, you can write me to the telegram group of the documentation.

TheHarold added a commit that referenced this issue Aug 13, 2023
TheHarold added a commit that referenced this issue Aug 13, 2023
@Leci37
Copy link
Owner

Leci37 commented Aug 22, 2023

solved in the last version of https://github.com/Leci37/stocks-prediction-Machine-learning-RealTime-TensorFlow/blob/master/0_API_alphavantage_get_old_history.py

but is better use alapaca o yahoo to get the full data

@Leci37
Copy link
Owner

Leci37 commented Aug 23, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants