Hear stock quotes from Google Assistant or Alexa
Russ last edited by Russ
This Powershell script calls the API and sends the result back to TRIGGERcmd so Alexa or Google Assistant can speak the price.
The "demo" API key can only lookup Microsoft, so you'll want to get a free API key from https://www.alphavantage.co to lookup your own stocks.
I added this as an example in Browse Examples in the GUI editor.
This only works on Windows, but let me know if you want me to do a Mac or Linux version of this script.
$symbol="MSFT" $apikey="demo" $resource="https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=$symbol&apikey=$apikey" $response=Invoke-RestMethod -Method Get -Uri $resource $price=$response.'Global Quote'.'05. price' $cmd="$env:USERPROFILE\.TRIGGERcmdData\sendresult.bat" cmd /c $cmd $price
Configure the Voice Reply field like this:
There are a few other data points besides just price at this endpoint: