Previously, I tried to get the US stock price using Postman, but this time I tried to get it from Raspberry Pi using Python to divert it to application creation.
Get US Stocks Using Rapid API with Postman https://qiita.com/ShinPun/items/cc9a124e3bc64b4d3893
Please refer to the above article for how to get apikey.
import requests
url = "https://www.alphavantage.co/query"
querystring = {"interval":"5min","function":"TIME_SERIES_INTRADAY","symbol":"MSFT","datatype":"json","output_size":"compact","apikey":"XXXXXXYYYYYYYZZZZZZZ"}
response = requests.request("GET", url,params=querystring)
print(response.text)
Python 3.7.3. Run-time screen. I was able to get the stock price every 5 minutes.
Recommended Posts