Kev 69 Posted May 28, 2019 Report Share Posted May 28, 2019 Hi all,Been having some fun with APIs and trying to develop my own skillset more. I am looking at this demo API result which is produced in JSON: https://www.alphavantage.co/query?function=SECTOR&apikey=demo What are the best ways to handle this data with as little resources as possible? Right now here's what I am doing:Adding the entire page (set variable and use http get) to a list. I then set the desired position to the results I want and delete the pieces of info I don't need from the list position.Is that the best way to handle this JSON presented data? Whilst I do technically have a solution, I can't help but think there may be a "cleaner" solution. Cheers! Kev Quote Link to post Share on other sites
bestmacros 60 Posted May 29, 2019 Report Share Posted May 29, 2019 jsonpath pluginhttp://network.ubotstudio.com/forum/index.php/topic/16166-free-plugin-jsonpath-parser-plugin/?p=93802 Quote Link to post Share on other sites
gijosu 9 Posted May 29, 2019 Report Share Posted May 29, 2019 and use JsonPathBuilderPro , will make it easy for you Quote Link to post Share on other sites
Kev 69 Posted May 29, 2019 Author Report Share Posted May 29, 2019 Can anyone tell me the jsonPath for this URL: https://www.alphavantage.co/query?function=SMA&symbol=MSFT&interval=weekly&time_period=10&series_type=open&apikey=demo I want to get the first result inside "Technical Analysis" "SMA" - the value in there. I can do: $Meta Data.* and get everything from 1 through 7 but can't figure out how to get the next portion Cheers, Kev PS I am using the jsonPath plugin! Quote Link to post Share on other sites
gijosu 9 Posted May 30, 2019 Report Share Posted May 30, 2019 use JsonPathBuilderPro will help you and make json easier set(#HttpGet,$plugin function("HeopasCustom.dll", "$Heopas HTTP Get", "https://www.alphavantage.co/query?function=SMA&symbol=MSFT&interval=weekly&time_period=10&series_type=open&apikey=demo", "", "", "", "", ""),"Global")clear list(%SMA)add list to list(%SMA,$list from text($plugin function("JSONpath.dll", "$JSONpath parser", #HttpGet, "Technical Analysis: SMA.*.SMA"),$new line),"Delete","Global")set(#SMA,$list item(%SMA,0),"Global")alert("First SMA : {#SMA}") Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.