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

**URL:** <https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614>\
**Category:** Questions & Help\
**Tags:** tools, flow\
**Created:** [June 20, 2021, 11:46am UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614 "2021-06-20T11:46:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adrian\_Haaland](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_haaland/32/34437_2.png) [@Adrian\_Haaland](https://community.homey.app/u/Adrian_Haaland)\
**Post date:** [June 20, 2021, 11:46am UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/1 "2021-06-20T11:46:20Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![Kongedam](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kongedam/32/35807_2.png) [@Kongedam](https://community.homey.app/u/Kongedam)\
**Post date:** [June 21, 2021, 3:16pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/2 "2021-06-21T15:16:35Z")

</div>

Maybe this post can lead you in the right direction

> [@Storing JSON data back from a POST request](https://community.homey.app/t/storing-json-data-back-from-a-post-request/9551/2):
>
> Have solved my problem with the awesome help from @robertklep over on the Slack channel For the HTTP request cards, you can specify advanced options in the URL box - and the gold was that you can include the payload/body as a json in that url string. So what I’ve done is: 1 flow that does the web service call - using a GET JSON trigger object. Using advanced options you enter the full string into the url field - so in my case I needed to do a POST and therefore the url field was: {“method”:“…

> [@Calling an external service and receiving the Response in a variable?](https://community.homey.app/t/calling-an-external-service-and-receiving-the-response-in-a-variable/12445/13):
>
> Hi all, Sorry for this delayed response, but I had to find some time for it. There are several ways to build the flows @Jef_van_Leeuwen requested. Because he wants to map multiple values from the same HTTP response it’s best to make 2 flows with combine cards GET JSON trigger object (A24), JSON object (T81) and JSONpath Better Logic (A80). (Native Homey logic support is in development, but for now we rely on BetterLogic for storing variables). When in doubt validate your JSON values for fl…

---

<div class="post-metadata">

**Author:** ![Marcel\_Ubels](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcel_ubels/32/18860_2.png) [@Marcel\_Ubels](https://community.homey.app/u/Marcel_Ubels)\
**Post date:** [June 21, 2021, 6:04pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/3 "2021-06-21T18:04:45Z")

</div>

Make a flow and at the THEN part

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/1/d1d0125889db3c42650ed4a431e7bdc2fa0a9430.jpeg)

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

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/f/5f3e7892d020973225126c74b4703c33c9eb1cf3.jpeg)

At the THEN part

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/d/4d7c4c3840f1f3ad5990ba390eb90a2e4b9067f8.jpeg)

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

---

<div class="post-metadata">

**Author:** ![Adrian\_Haaland](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_haaland/32/34437_2.png) [@Adrian\_Haaland](https://community.homey.app/u/Adrian_Haaland)\
**Post date:** [June 21, 2021, 6:55pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/4 "2021-06-21T18:55:32Z")

</div>

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”.

 ![Screenshot_20210621-205521_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/0/80611109f90513442cb90ec856d15756de2e51e1.jpeg)

---

<div class="post-metadata">

**Author:** ![Adrian\_Haaland](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_haaland/32/34437_2.png) [@Adrian\_Haaland](https://community.homey.app/u/Adrian_Haaland)\
**Post date:** [June 21, 2021, 6:56pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/5 "2021-06-21T18:56:04Z")

</div>

![Screenshot_20210621-205551_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/e/0eb03437d57d61945d2929aa8c7303eeb9fa523e.jpeg)

---

<div class="post-metadata">

**Author:** ![Adrian\_Haaland](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_haaland/32/34437_2.png) [@Adrian\_Haaland](https://community.homey.app/u/Adrian_Haaland)\
**Post date:** [June 21, 2021, 6:56pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/6 "2021-06-21T18:56:35Z")

</div>

![Screenshot_20210621-205619_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/a/2a1e3ded6a2785ba9174d6bec3bb7e9920c5e2ed.jpeg)

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [June 21, 2021, 7:13pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/7 "2021-06-21T19:13:58Z")

</div>

Why not " GET Json path better logic" ?

---

<div class="post-metadata">

**Author:** ![Adrian\_Haaland](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_haaland/32/34437_2.png) [@Adrian\_Haaland](https://community.homey.app/u/Adrian_Haaland)\
**Post date:** [June 21, 2021, 7:17pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/8 "2021-06-21T19:17:29Z")

</div>

Thanks. It looks like that solved it!

Many thanks everyone 😁👍

---

<div class="post-metadata">

**Author:** ![TKroon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tkroon/32/9504_2.png) [@TKroon](https://community.homey.app/u/TKroon)\
**Post date:** [April 6, 2022, 6:47pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/9 "2022-04-06T18:47:37Z")

</div>

Hi everyone!

I have the same problem. I’d like to setup a GET JSONpath Better Logic.

![Schermafbeelding 2022-04-06 om 20.40.18](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/6/26b027978dac03705396ca48070ca2419551b959.png)

When I enter this GET URL in my browser, I get the response below. The information I want to extract is battery level, which is “level”: 56.0 in the text. I’ve tried every combination, but get “Value not found” as Homey’s error message.

{“embedded”: null, “links”: {"\_self": {“deprecation”: null, “href”: “[https://api.groupe-psa.com/connectedcar/v4/user/vehicles/](https://api.groupe-psa.com/connectedcar/v4/user/vehicles/)/status”, “hreflang”: null, “name”: null, “profile”: null, “templated”: null, “title”: null, “type”: null}, “vehicle”: null}, “battery”: {“current”: 0.0, “voltage”: 97.5}, “doors\_state”: null, “energy”: [{“updated\_at”: “2022-04-06 18:22:45+00:00”, “autonomy”: 146.0, “battery”: null, “charging”: {“charging\_mode”: “Slow”, “charging\_rate”: 0, “next\_delayed\_time”: “PT0S”, “plugged”: true, “remaining\_time”: “PT7H10M”, “status”: “InProgress”}, “consumption”: null, “level”: 56.0, “residual”: null, “type”: “Electric”}], “environment”: null, “ignition”: null, “kinetic”: {“acceleration”: null, “moving”: null, “pace”: null, “speed”: null}, “last\_position”: {“type”: “Feature”, “geometry”: {“coordinates”: [null, null, null], “type”: “Point”}, “properties”: {“heading”: null, “signal\_quality”: null, “type”: null, “updated\_at”: null}}, “preconditionning”: {“air\_conditioning”: {“failure\_cause”: null, “programs”: null, “status”: “Disabled”, “updated\_at”: “2022-04-06 18:22:45+00:00”}}, “privacy”: {“state”: “None”}, “safety”: null, “service”: {“type”: “Electric”, “updated\_at”: “2022-04-06 18:22:45+00:00”}, “timed\_odometer”: {“updated\_at”: null, “mileage”: 563.5}}

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [April 6, 2022, 6:52pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/10 "2022-04-06T18:52:05Z")

</div>

Please format the JSON using the `</>` button.

---

<div class="post-metadata">

**Author:** ![TKroon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tkroon/32/9504_2.png) [@TKroon](https://community.homey.app/u/TKroon)\
**Post date:** [April 6, 2022, 6:54pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/11 "2022-04-06T18:54:23Z")

</div>

Thanks @robertklep for your quick reply. Could you be more specific? When I change the URL to I get “Cannot read property “indexOf” null” from Homey.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [April 6, 2022, 6:55pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/12 "2022-04-06T18:55:33Z")

</div>

> [@TKroon](#):
>
> Could you be more specific?

The JSON you pasted in your forum post 😅 It’s hard to read right now.

---

<div class="post-metadata">

**Author:** ![TKroon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tkroon/32/9504_2.png) [@TKroon](https://community.homey.app/u/TKroon)\
**Post date:** [April 6, 2022, 6:56pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/13 "2022-04-06T18:56:06Z")

</div>

Hahaha!

`http://10.0.0.2:33208/get_vehicleinfo/VR3<knip>?from_cache=1`

This URL does work in my browser.

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [April 6, 2022, 6:57pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/14 "2022-04-06T18:57:26Z")

</div>

No, this:

```auto
{"embedded": null, "links": …

```

---

<div class="post-metadata">

**Author:** ![TKroon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tkroon/32/9504_2.png) [@TKroon](https://community.homey.app/u/TKroon)\
**Post date:** [April 6, 2022, 6:57pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/15 "2022-04-06T18:57:53Z")

</div>

```auto
{"embedded": null, "links": {"_self": {"deprecation": null, "href": "https://api.groupe-psa.com/connectedcar/v4/user/vehicles/<knip>/status", "hreflang": null, "name": null, "profile": null, "templated": null, "title": null, "type": null}, "vehicle": null}, "battery": {"current": 0.0, "voltage": 97.5}, "doors_state": null, "energy": [{"updated_at": "2022-04-06 18:22:45+00:00", "autonomy": 146.0, "battery": null, "charging": {"charging_mode": "Slow", "charging_rate": 0, "next_delayed_time": "PT0S", "plugged": true, "remaining_time": "PT7H10M", "status": "InProgress"}, "consumption": null, "level": 56.0, "residual": null, "type": "Electric"}], "environment": null, "ignition": null, "kinetic": {"acceleration": null, "moving": null, "pace": null, "speed": null}, "last_position": {"type": "Feature", "geometry": {"coordinates": [null, null, null], "type": "Point"}, "properties": {"heading": null, "signal_quality": null, "type": null, "updated_at": null}}, "preconditionning": {"air_conditioning": {"failure_cause": null, "programs": null, "status": "Disabled", "updated_at": "2022-04-06 18:22:45+00:00"}}, "privacy": {"state": "None"}, "safety": null, "service": {"type": "Electric", "updated_at": "2022-04-06 18:22:45+00:00"}, "timed_odometer": {"updated_at": null, "mileage": 563.5}}

```

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [April 6, 2022, 7:00pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/16 "2022-04-06T19:00:21Z")

</div>

From what I can see, the JSONPath should be `$.energy[0].level`

You can test here: [https://jsonpath.com/](https://jsonpath.com/)

---

<div class="post-metadata">

**Author:** ![TKroon](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tkroon/32/9504_2.png) [@TKroon](https://community.homey.app/u/TKroon)\
**Post date:** [April 6, 2022, 7:02pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/17 "2022-04-06T19:02:16Z")

</div>

Awesome, that did the trick. Never would have guessed that, but now I get the format. Thanks a lot!!!

---

<div class="post-metadata">

**Author:** ![Wout\_van\_den\_Dool](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wout_van_den_dool/32/391_2.png) [@Wout\_van\_den\_Dool](https://community.homey.app/u/Wout_van_den_Dool)\
**Post date:** [April 26, 2022, 9:31pm UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/18 "2022-04-26T21:31:36Z")

</div>

**I am almost there, just missing the last bits, who can help me so I can complete the tutorial:**

Usecase: I want to retrieve from weatherunderground the precipitation (neerslag) for the coming 5 days. And store the 5 day values in the below created variables in Logic.

I took these steps:

1. Create Numeric tags in Logic  

2. Create the API call via weatherunderground:

- Selected Geocode API, followed the instructions [here](https://docs.google.com/document/d/1_Zte7-SdOjnzBttb1-Y9e0Wgl0_3tah9dSwXUyEA3-c/edit):
- Selected format JSON
- Selected units M (metric)
- Selected language (nl-NL)
- Inserted secret API Key from my profile

That resulted in this API request:  
[https://api.weather.com/v3/wx/forecast/daily/5day?geocode=52.03,5.16&format=json&units=m&language=nl-NL&apiKey=xxxxxxx](https://api.weather.com/v3/wx/forecast/daily/5day?geocode=52.03,5.16&format=json&units=m&language=nl-NL&apiKey=xxxxxxx)

1. Fetch the JSON file (via browser)  
That resulted in this JSON output:

```auto
{"calendarDayTemperatureMax":[16,14,17,14,13,15],"calendarDayTemperatureMin":[4,2,3,4,5,4],"dayOfWeek":["Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag","Zondag"],"expirationTimeUtc":[1650988944,1650988944,1650988944,1650988944,1650988944,1650988944],"moonPhase":["Asgrauwe maan","Asgrauwe maan","Asgrauwe maan","Asgrauwe maan","Nieuwe maan","Nieuwe maan"],"moonPhaseCode":["WNC","WNC","WNC","WNC","N","N"],"moonPhaseDay":[25,26,27,28,29,0],"moonriseTimeLocal":["2022-04-26T05:23:16+0200","2022-04-27T05:37:40+0200","2022-04-28T05:50:18+0200","2022-04-29T06:02:22+0200","2022-04-30T06:15:06+0200","2022-05-01T06:29:45+0200"],"moonriseTimeUtc":[1650943396,1651030660,1651117818,1651204942,1651292106,1651379385],"moonsetTimeLocal":["2022-04-26T15:40:50+0200","2022-04-27T16:59:14+0200","2022-04-28T18:15:30+0200","2022-04-29T19:31:19+0200","2022-04-30T20:45:57+0200","2022-05-01T22:00:55+0200"],"moonsetTimeUtc":[1650980450,1651071554,1651162530,1651253479,1651344357,1651435255],"narrative":["Regenbuien vroeg. Minimaal 2C.","Gedeeltelijk bewolkt. Maximaal 13 tot 15C en minimaal 2 tot 4C.","Gedeeltelijk bewolkt. Maximaal 16 tot 18C en minimaal 3 tot 5C.","Bewolkt. Maximaal 13 tot 15C en minimaal 4 tot 6C.","Ochtendbuien. Maximaal 13 tot 15C en minimaal 3 tot 5C.","Gedeeltelijk bewolkt. Maximaal 14 tot 16C en minimaal 3 tot 5C."],"qpf":[0.03,0.0,0.0,0.0,0.5,0.0],"qpfSnow":[0.0,0.0,0.0,0.0,0.0,0.0],"sunriseTimeLocal":["2022-04-26T06:19:29+0200","2022-04-27T06:17:29+0200","2022-04-28T06:15:30+0200","2022-04-29T06:13:32+0200","2022-04-30T06:11:36+0200","2022-05-01T06:09:42+0200"],"sunriseTimeUtc":[1650946769,1651033049,1651119330,1651205612,1651291896,1651378182],"sunsetTimeLocal":["2022-04-26T20:55:53+0200","2022-04-27T20:57:36+0200","2022-04-28T20:59:19+0200","2022-04-29T21:01:02+0200","2022-04-30T21:02:44+0200","2022-05-01T21:04:26+0200"],"sunsetTimeUtc":[1650999353,1651085856,1651172359,1651258862,1651345364,1651431866],"temperatureMax":[null,14,17,14,14,15],"temperatureMin":[2,3,4,5,4,4],"validTimeLocal":["2022-04-26T07:00:00+0200","2022-04-27T07:00:00+0200","2022-04-28T07:00:00+0200","2022-04-29T07:00:00+0200","2022-04-30T07:00:00+0200","2022-05-01T07:00:00+0200"],"validTimeUtc":[1650949200,1651035600,1651122000,1651208400,1651294800,1651381200],"daypart":[{"cloudCover":[null,19,54,21,30,66,90,58,70,51,61,36],"dayOrNight":[null,"N","D","N","D","N","D","N","D","N","D","N"],"daypartName":[null,"Vanavond","Morgen","Morgenavond","Donderdag","Donderdagnacht","Vrijdag","Vrijdagnacht","Zaterdag","Zaterdagnacht","Zondag","Zondagnacht"],"iconCode":[null,45,30,29,30,27,26,29,39,29,30,29],"iconCodeExtend":[null,6100,3000,2900,3000,2700,2600,2900,6103,2900,3000,2900],"narrative":[null,"Regenbuien vroeg. Minimaal 2C. Wind uit het N van 10 tot 15 km/u. Kans op regen 30%.","Gedeeltelijk bewolkt. Maximaal 14C. Wind uit het N van 10 tot 15 km/u.","Gedeeltelijk bewolkt. Minimaal 3C. Wind uit het N van 10 tot 15 km/u.","Gedeeltelijk bewolkt. Warmer. Maximaal 17C. Wind uit het NO van 10 tot 15 km/u.","Overwegend bewolkt. Minimaal 4C. Wind uit het NNO van 10 tot 15 km/u.","Bewolkt. Maximaal 14C. Wind uit het NNO van 15 tot 25 km/u.","Gedeeltelijk bewolkt. Minimaal 5C. Wind uit het NNO van 15 tot 25 km/u.","Ochtendbuien. Maximaal 14C. Wind uit het NNO van 15 tot 25 km/u. Kans op regen 40%.","Gedeeltelijk bewolkt. Minimaal 4C. Wind uit het N van 15 tot 25 km/u.","Gedeeltelijk bewolkt. Maximaal 15C. Wind uit het NNO van 10 tot 15 km/u.","Gedeeltelijk bewolkt. Minimaal 4C. Wind uit het N van 10 tot 15 km/u."],"precipChance":[null,33,22,15,14,10,10,21,36,12,19,12],"precipType":[null,"rain","rain","precip","rain","precip","rain","rain","rain","precip","rain","precip"],"qpf":[null,0.03,0.0,0.0,0.0,0.0,0.0,0.0,0.5,0.0,0.0,0.0],"qpfSnow":[null,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"qualifierCode":[null,null,null,null,"Q630",null,null,null,null,null,null,null],"qualifierPhrase":[null,null,null,null,"Warmer.",null,null,null,null,null,null,null],"relativeHumidity":[null,75,63,80,62,71,61,73,63,76,60,76],"snowRange":[null,"","","","","","","","","","",""],"temperature":[null,2,14,3,17,4,14,5,14,4,15,4],"temperatureHeatIndex":[null,13,14,13,16,15,14,12,13,12,15,14],"temperatureWindChill":[null,3,4,2,2,2,2,3,4,3,4,4],"thunderCategory":[null,null,null,null,null,null,null,null,null,null,null,null],"thunderIndex":[null,0,0,0,0,0,0,0,0,0,0,0],"uvDescription":[null,"Laag","Gemiddeld","Laag","Gemiddeld","Laag","Laag","Laag","Gemiddeld","Laag","Gemiddeld","Laag"],"uvIndex":[null,0,4,0,5,0,2,0,3,0,4,0],"windDirection":[null,349,353,10,34,30,33,18,14,6,13,0],"windDirectionCardinal":[null,"N","N","N","NO","NNO","NNO","NNO","NNO","N","NNO","N"],"windPhrase":[null,"Wind uit het N van 10 tot 15 km/u.","Wind uit het N van 10 tot 15 km/u.","Wind uit het N van 10 tot 15 km/u.","Wind uit het NO van 10 tot 15 km/u.","Wind uit het NNO van 10 tot 15 km/u.","Wind uit het NNO van 15 tot 25 km/u.","Wind uit het NNO van 15 tot 25 km/u.","Wind uit het NNO van 15 tot 25 km/u.","Wind uit het N van 15 tot 25 km/u.","Wind uit het NNO van 10 tot 15 km/u.","Wind uit het N van 10 tot 15 km/u."],"windSpeed":[null,16,11,13,14,16,19,20,18,18,16,16],"wxPhraseLong":[null,"Buien vroeg","Gedeeltelijk bewolkt","Gedeeltelijk bewolkt","Gedeeltelijk bewolkt","Overwegend bewolkt","Bewolkt","Gedeeltelijk bewolkt","Ochtendbuien","Gedeeltelijk bewolkt","Gedeeltelijk bewolkt","Gedeeltelijk bewolkt"],"wxPhraseShort":[null,"","","","","","","","","","",""]}]}

```

Screenshot:

 ![CleanShot 2022-04-26 at 22.58.13 - Notepad@2x](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/1/e13b7c741b645e741a33faf3ab1878bfdfc626f3.jpeg)

1. Copy paste Json txt in [https://jsonpath.com](https://jsonpath.com) to extract Jsonpath

Copy paste the Json file in Inputs, find the data you need, in my case qpf and play with the path, when you execute it correct you see the value you want to fetch and store

 ![CleanShot 2022-04-26 at 23.09.46 - Safari@2x](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/e/de941879cfee1c5c596fb2be9d817cb06b1f38d2.jpeg)

You can also use [https://jsonpathfinder.com](https://jsonpathfinder.com) and clean up the code, you get something like this in return:

 ![CleanShot 2022-04-26 at 23.16.47 - Safari@2x](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/7/0725aa598c01f47ebd49c756e54eb3daff221dc0.jpeg)

1. Set up the flow in Homey via Get  
 ![CleanShot 2022-04-26 at 23.17.22 - Safari@2x](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/b/bb92afbad09d9306fc2643554a35d352479bf779.jpeg)

-1. If statement: After 04 o clock the Underground API seems to be updated therefore 04:15  
-Select the Logic card “Maak een webverzoek”  
-Select GET request  
-2. Copy Paste the url from weatherUnderground  
-3. Select Headers, I filled in the example text, Content-type: json  
-4. Select Body, I did something but doesn’t result in a variable

So in the last steps I need some help… @robertklep ? 🙂

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [April 27, 2022, 4:51am UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/19 "2022-04-27T04:51:50Z")

</div>

You can’t use Logica for this, you need the HTTP Request Flow Cards app. Logica can’t be used to extract information from web requests (you are _sending_ the JSONPath expression to the Wunderground server now 😉 )

---

<div class="post-metadata">

**Author:** ![Wout\_van\_den\_Dool](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wout_van_den_dool/32/391_2.png) [@Wout\_van\_den\_Dool](https://community.homey.app/u/Wout_van_den_Dool)\
**Post date:** [April 27, 2022, 10:35am UTC](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614/20 "2022-04-27T10:35:28Z")

</div>

Usecase: I want to retrieve from weatherunderground the precipitation (neerslag) for the coming 5 days. And store the 5 day values in the below created variables in Logic.

Pre-requisites:  
1.Better Logic App  
2. HTTP Request App  
3. Weatherunderground Api Key (for free)

I took these steps:

1. Create Numeric tags in Better Logic  

2. Create the API call via weatherunderground:

- Selected Geocode API, followed the instructions [here](https://docs.google.com/document/d/1_Zte7-SdOjnzBttb1-Y9e0Wgl0_3tah9dSwXUyEA3-c/edit):
- Selected format JSON
- Selected units M (metric)
- Selected language (nl-NL)
- Inserted secret API Key from my profile

That resulted in this API request:  
[https://api.weather.com/v3/wx/forecast/daily/5day?geocode=52.03,5.16&format=json&units=m&language=nl-NL&apiKey=xxxxxxx](https://api.weather.com/v3/wx/forecast/daily/5day?geocode=52.03,5.16&format=json&units=m&language=nl-NL&apiKey=xxxxxxx)

1. Fetch the JSON file (via browser)  
That resulted in this JSON output:

```auto
{"calendarDayTemperatureMax":[16,14,17,14,13,15],"calendarDayTemperatureMin":[4,2,3,4,5,4],"dayOfWeek":["Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag","Zondag"],"expirationTimeUtc":[1650988944,1650988944,1650988944,1650988944,1650988944,1650988944],"moonPhase":["Asgrauwe maan","Asgrauwe maan","Asgrauwe maan","Asgrauwe maan","Nieuwe maan","Nieuwe maan"],"moonPhaseCode":["WNC","WNC","WNC","WNC","N","N"],"moonPhaseDay":[25,26,27,28,29,0],"moonriseTimeLocal":["2022-04-26T05:23:16+0200","2022-04-27T05:37:40+0200","2022-04-28T05:50:18+0200","2022-04-29T06:02:22+0200","2022-04-30T06:15:06+0200","2022-05-01T06:29:45+0200"],"moonriseTimeUtc":[1650943396,1651030660,1651117818,1651204942,1651292106,1651379385],"moonsetTimeLocal":["2022-04-26T15:40:50+0200","2022-04-27T16:59:14+0200","2022-04-28T18:15:30+0200","2022-04-29T19:31:19+0200","2022-04-30T20:45:57+0200","2022-05-01T22:00:55+0200"],"moonsetTimeUtc":[1650980450,1651071554,1651162530,1651253479,1651344357,1651435255],"narrative":["Regenbuien vroeg. Minimaal 2C.","Gedeeltelijk bewolkt. Maximaal 13 tot 15C en minimaal 2 tot 4C.","Gedeeltelijk bewolkt. Maximaal 16 tot 18C en minimaal 3 tot 5C.","Bewolkt. Maximaal 13 tot 15C en minimaal 4 tot 6C.","Ochtendbuien. Maximaal 13 tot 15C en minimaal 3 tot 5C.","Gedeeltelijk bewolkt. Maximaal 14 tot 16C en minimaal 3 tot 5C."],"qpf":[0.03,0.0,0.0,0.0,0.5,0.0],"qpfSnow":[0.0,0.0,0.0,0.0,0.0,0.0],"sunriseTimeLocal":["2022-04-26T06:19:29+0200","2022-04-27T06:17:29+0200","2022-04-28T06:15:30+0200","2022-04-29T06:13:32+0200","2022-04-30T06:11:36+0200","2022-05-01T06:09:42+0200"],"sunriseTimeUtc":[1650946769,1651033049,1651119330,1651205612,1651291896,1651378182],"sunsetTimeLocal":["2022-04-26T20:55:53+0200","2022-04-27T20:57:36+0200","2022-04-28T20:59:19+0200","2022-04-29T21:01:02+0200","2022-04-30T21:02:44+0200","2022-05-01T21:04:26+0200"],"sunsetTimeUtc":[1650999353,1651085856,1651172359,1651258862,1651345364,1651431866],"temperatureMax":[null,14,17,14,14,15],"temperatureMin":[2,3,4,5,4,4],"validTimeLocal":["2022-04-26T07:00:00+0200","2022-04-27T07:00:00+0200","2022-04-28T07:00:00+0200","2022-04-29T07:00:00+0200","2022-04-30T07:00:00+0200","2022-05-01T07:00:00+0200"],"validTimeUtc":[1650949200,1651035600,1651122000,1651208400,1651294800,1651381200],"daypart":[{"cloudCover":[null,19,54,21,30,66,90,58,70,51,61,36],"dayOrNight":[null,"N","D","N","D","N","D","N","D","N","D","N"],"daypartName":[null,"Vanavond","Morgen","Morgenavond","Donderdag","Donderdagnacht","Vrijdag","Vrijdagnacht","Zaterdag","Zaterdagnacht","Zondag","Zondagnacht"],"iconCode":[null,45,30,29,30,27,26,29,39,29,30,29],"iconCodeExtend":[null,6100,3000,2900,3000,2700,2600,2900,6103,2900,3000,2900],"narrative":[null,"Regenbuien vroeg. Minimaal 2C. Wind uit het N van 10 tot 15 km/u. Kans op regen 30%.","Gedeeltelijk bewolkt. Maximaal 14C. Wind uit het N van 10 tot 15 km/u.","Gedeeltelijk bewolkt. Minimaal 3C. Wind uit het N van 10 tot 15 km/u.","Gedeeltelijk bewolkt. Warmer. Maximaal 17C. Wind uit het NO van 10 tot 15 km/u.","Overwegend bewolkt. Minimaal 4C. Wind uit het NNO van 10 tot 15 km/u.","Bewolkt. Maximaal 14C. Wind uit het NNO van 15 tot 25 km/u.","Gedeeltelijk bewolkt. Minimaal 5C. Wind uit het NNO van 15 tot 25 km/u.","Ochtendbuien. Maximaal 14C. Wind uit het NNO van 15 tot 25 km/u. Kans op regen 40%.","Gedeeltelijk bewolkt. Minimaal 4C. Wind uit het N van 15 tot 25 km/u.","Gedeeltelijk bewolkt. Maximaal 15C. Wind uit het NNO van 10 tot 15 km/u.","Gedeeltelijk bewolkt. Minimaal 4C. Wind uit het N van 10 tot 15 km/u."],"precipChance":[null,33,22,15,14,10,10,21,36,12,19,12],"precipType":[null,"rain","rain","precip","rain","precip","rain","rain","rain","precip","rain","precip"],"qpf":[null,0.03,0.0,0.0,0.0,0.0,0.0,0.0,0.5,0.0,0.0,0.0],"qpfSnow":[null,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0],"qualifierCode":[null,null,null,null,"Q630",null,null,null,null,null,null,null],"qualifierPhrase":[null,null,null,null,"Warmer.",null,null,null,null,null,null,null],"relativeHumidity":[null,75,63,80,62,71,61,73,63,76,60,76],"snowRange":[null,"","","","","","","","","","",""],"temperature":[null,2,14,3,17,4,14,5,14,4,15,4],"temperatureHeatIndex":[null,13,14,13,16,15,14,12,13,12,15,14],"temperatureWindChill":[null,3,4,2,2,2,2,3,4,3,4,4],"thunderCategory":[null,null,null,null,null,null,null,null,null,null,null,null],"thunderIndex":[null,0,0,0,0,0,0,0,0,0,0,0],"uvDescription":[null,"Laag","Gemiddeld","Laag","Gemiddeld","Laag","Laag","Laag","Gemiddeld","Laag","Gemiddeld","Laag"],"uvIndex":[null,0,4,0,5,0,2,0,3,0,4,0],"windDirection":[null,349,353,10,34,30,33,18,14,6,13,0],"windDirectionCardinal":[null,"N","N","N","NO","NNO","NNO","NNO","NNO","N","NNO","N"],"windPhrase":[null,"Wind uit het N van 10 tot 15 km/u.","Wind uit het N van 10 tot 15 km/u.","Wind uit het N van 10 tot 15 km/u.","Wind uit het NO van 10 tot 15 km/u.","Wind uit het NNO van 10 tot 15 km/u.","Wind uit het NNO van 15 tot 25 km/u.","Wind uit het NNO van 15 tot 25 km/u.","Wind uit het NNO van 15 tot 25 km/u.","Wind uit het N van 15 tot 25 km/u.","Wind uit het NNO van 10 tot 15 km/u.","Wind uit het N van 10 tot 15 km/u."],"windSpeed":[null,16,11,13,14,16,19,20,18,18,16,16],"wxPhraseLong":[null,"Buien vroeg","Gedeeltelijk bewolkt","Gedeeltelijk bewolkt","Gedeeltelijk bewolkt","Overwegend bewolkt","Bewolkt","Gedeeltelijk bewolkt","Ochtendbuien","Gedeeltelijk bewolkt","Gedeeltelijk bewolkt","Gedeeltelijk bewolkt"],"wxPhraseShort":[null,"","","","","","","","","","",""]}]}

```

Screenshot:

 ![CleanShot 2022-04-26 at 22.58.13 - Notepad@2x](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/1/e13b7c741b645e741a33faf3ab1878bfdfc626f3.jpeg)

1. Copy paste Json txt in [https://jsonpath.com](https://jsonpath.com) to extract Jsonpath

Copy paste the Json file in Inputs, find the data you need, in my case qpf and play with the path, when you execute it correct you see the value you want to fetch and store

 ![CleanShot 2022-04-26 at 23.09.46 - Safari@2x](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/e/de941879cfee1c5c596fb2be9d817cb06b1f38d2.jpeg)

You can also use [https://jsonpathfinder.com](https://jsonpathfinder.com) and clean up the code, you get something like this in return:

 ![CleanShot 2022-04-26 at 23.16.47 - Safari@2x](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/7/0725aa598c01f47ebd49c756e54eb3daff221dc0.jpeg)

1. Set up the flow in Homey via Get  
 ![CleanShot 2022-04-27 at 12.20.49 - Safari@2x](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/1/e1cdcdf608ebe7e0171c324dd8aa46280854d125.jpeg)

- If statement: After 04 o clock the Underground API seems to be updated therefore 04:15
- Select the “Get Jasonpath Better Logic” card
- Copy Paste the url from weatherUnderground
- Copy Paste the Jsonpath
- Select BetterLogic tag you want to write it to

Thanks @robertklep ? 🙂 for the last nudge, now it works…

[Next page](https://community.homey.app/t/setting-up-simple-get-request-and-storing-value-as-numeric-logic-object/48614.md?page=2)
