Quotes from alphavantage.co:
#!/usr/bin/python3 import requests key = "xxxxxxxxx" # key is free (5 requests per minute, 500 requests per day) tic = "ibm" url = "https://www.alphavantage.co/query?apikey="+key+"&function=TIME_SERIES_DAILY&symbol="+ tic rsp = requests.get(url) if rsp.status_code in (200,): ustr = rsp.text.strip() print(ustr) else: print("ERROR:", rsp.status_code) print(rsp.text)
Output:{
"Meta Data": {
"1. Information": "Daily Prices (open, high, low, close) and Volumes",
"2. Symbol": "ibm",
"3. Last Refreshed": "2019-05-23",
"4. Output Size": "Compact",
"5. Time Zone": "US/Eastern"
},
"Time Series (Daily)": {
"2019-05-23": {
"1. open": "135.1300",
"2. high": "135.1300",
"3. low": "130.4400",
"4. close": "132.3900",
"5. volume": "5342570"
},
"2019-05-22": {
"1. open": "136.0000",
"2. high": "136.7500",
"3. low": "135.7116",
"4. close": "136.3500",
"5. volume": "1849821"
},
"2019-05-21": {
"1. open": "136.1200",
"2. high": "137.0600",
"3. low": "135.7900",
"4. close": "136.4500",
"5. volume": "2503504"
}
}
}