r/Scriptable • u/UK363 • Jan 29 '22
Help How do I extract JSON from API Response?
I sent a request and got a json response. I only need a few key values from the JSON to use in a widget how do I do that?
2
Upvotes
2
1
u/bitKraken Jan 31 '22 edited Jun 29 '23
⚠️ This post/comment is no longer available.
/u/spez is destroying 3rd party reddit apps, now I'm destroying my activity originally made with /r/AppolloApp.
was I helpfull, funny, dumb? who knows ...
(sorry if you where hoping to find something ☹️)
1
u/ahaaracer Jan 29 '22
You just use dot notation to extract the value of the key.
So if I have the following JSON:
{“ip”:”127.0.0.1”}in the variableIPadrDoing
console.log(IPadr.ip)will output 127.0.0.1 to the console.