import requests
import pandas as pd
api_key = YOUR_API_KEY
ticker = "GOOGL"
keyword = "TIME_SERIES_DAILY_ADJUSTED"
url = f"https://www.alphavantage.co/query?function={keyword}&symbol={ticker}&apikey={api_key}"
response = requests.get(url)
stock_data = response.json()["Time Series (Daily)"]
df_daily = pd.DataFrame.from_dict(stock_data, orient="index", dtype=float)
df_daily
1. open | 2. high | 3. low | 4. close | 5. adjusted close | 6. volume | 7. dividend amount | 8. split coefficient | |
---|---|---|---|---|---|---|---|---|
2023-05-30 | 125.64 | 125.660 | 122.0000 | 123.67 | 123.67 | 35076658.0 | 0.0 | 1.0 |
2023-05-26 | 123.17 | 125.260 | 122.4500 | 124.61 | 124.61 | 35635937.0 | 0.0 | 1.0 |
2023-05-25 | 124.52 | 125.320 | 121.9600 | 123.48 | 123.48 | 42316986.0 | 0.0 | 1.0 |
2023-05-24 | 121.12 | 121.910 | 119.8600 | 120.90 | 120.90 | 34182635.0 | 0.0 | 1.0 |
2023-05-23 | 124.16 | 124.625 | 122.2104 | 122.56 | 122.56 | 34046251.0 | 0.0 | 1.0 |
... | ... | ... | ... | ... | ... | ... | ... | ... |
2023-01-11 | 89.18 | 91.600 | 89.0100 | 91.52 | 91.52 | 26861969.0 | 0.0 | 1.0 |
2023-01-10 | 85.98 | 88.670 | 85.8300 | 88.42 | 88.42 | 30467755.0 | 0.0 | 1.0 |
2023-01-09 | 88.36 | 90.050 | 87.8600 | 88.02 | 88.02 | 29003901.0 | 0.0 | 1.0 |
2023-01-06 | 86.79 | 87.690 | 84.8600 | 87.34 | 87.34 | 41381495.0 | 0.0 | 1.0 |
2023-01-05 | 87.47 | 87.570 | 85.9000 | 86.20 | 86.20 | 27194375.0 | 0.0 | 1.0 |
100 rows × 8 columns