Hi,
I’m sorry for the stupid question, but I am not able to decypher a rest API.
Basically I want to get the value of a stock price as a sensor.
For this I planned to use this REST API:
https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=IBM&apikey=demo
The output is the following:
{
"Global Quote": {
"01. symbol": "IBM",
"02. open": "133.5200",
"03. high": "133.6000",
"04. low": "131.0200",
"05. price": "131.8700",
"06. volume": "5391520",
"07. latest trading day": "2020-06-09",
"08. previous close": "135.7500",
"09. change": "-3.8800",
"10. change percent": "-2.8582%"
}
}
The REST Sensor I was trying to use and does not work… (I tried different variants):
- platform: rest
resource: https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=IBM&apikey=demo
name: Stockprice
json_attributes_path: "GLOBAL_QUOTE"
json_attributes:
- "05. price"
scan_interval: 3600
also value_template: “{{ value_json.getString(“05. price”) }}” does not work…
Anyone has a clue how to get the price into the sensor attribute?