Homey Community Forum

Setting up simple GET request and storing value as numeric logic object

Hi everyone. Hope someone more familiar with GET requests can help me out here, as I’m new to the syntax required to setup GET responses.

I’m trying to setup a logic GET-request in one of my flows in order to periodically collect data on currency exchange rate USD_NOK. I’ve found several websites that offer free API’s for this. As an example: https://free.currconv.com/api/v7/convert?q=USD_NOK&compact=ultra&apiKey=ab47037514ac4157626c

This url returns a simple response like the example below:

{“USD_NOK”:8.670104}

How can I setup either logic GET request or HTTPS flow cards in order to fetch the second parameter, which today is “8.670104” - as a numeric logic object, in order to use it for logic calculations in other flows?

Help much appreciated, thanks

Maybe this post can lead you in the right direction

Make a flow and at the THEN part

Insert your api request at the first sentence and a name for this trigger e.g USDNOK

Make a better logic numeric variable.
Make a flow at the WHEN part insertvthe triggername eg USDNOK

At the THEN part

At the first sentence; $.USD_NOK[0]
At the second sentence your better logic variable name e.g USDNOK

Definitely getting closer, but I get a “object not found” error then testing the second flow.

Below are my input

I’ve made a better logic numeric variable named “usdnok” and named the trigger “USDtrigger”.

Why not " GET Json path better logic" ?

Thanks. It looks like that solved it!

Many thanks everyone :grin::+1:

1 Like