FWIW, @rextended's footer actually has some really fun and good examples of RouterOS script.
For JSON, I use this code to PARSE JSON from (e.g. response) from a call to /tool/fetch:
https://raw.githubusercontent.com/Winan ... eFunctions
And yeah non-trivial but seems to work.
If you cut-and-paste that to terminal, you should be able to use the $JSONLoads to parse JSON data from the /tool/fetch (what requests HTTPS like "curl" but different). A complex "one-line" that uses it looks like this...
:put "$([$JSONLoads ([/tool/fetch url="https://wttr.in/Riga?format=j1" output=user as-value]->"data")]->"current_condition")"
which prints (:put):
FeelsLikeC=-9;FeelsLikeF=15;cloudcover=100;humidity=93;localObsDateTime=2022-12-06 08:12 AM;observation_time=06:12 AM;precipInches=0.0;precipMM=0.3;pressure=1017;pressureInches=30
;temp_C=-4;temp_F=25;uvIndex=1;visibility=9;visibilityMiles=5;weatherCode=326;weatherDesc=value=Light snow;weatherIconUrl=value=;winddir16Point=SSE;winddirDegree=160;windspeedKmph
=15;windspeedMiles=9
Unwinding that, it uses data from wttr.in (for Riga Lativa), get the "data" from the responds, then calls $JSONLoads from the above JParseFunctions library. After that it uses the JSON data as a Miktotik array type, to access one part of the weather for "current conditions". With the ":put" being same as "print" in most languages. And "as-value" tells most commands, including /tool/fetch, you want to return data to use it variable/code, not print it screen.
As you can see possible, but learning all the [] vs () vs {} vs ; vs , vs $ vs \$ vs "$var" vs "$(var)" vs "$[script]" takes more time.
To generate the JSON (e.g. a request), you just need to learn /tool/fetch specifics params (see help.mirkotik.com), and RouterOS syntax (see Scripting section in help) for escaping since both JSON and RouterOS - essentially both dollar signs (unless your want to substitute a variable) and double quotes needs to be escaped in the http-data of /tool/fetch.
Tinker myself. Now a more fun example, I wrote a "command line remote control" for my RokuTV a while back. So you can switch TV channels (well streaming services, I guess), volume, etc:
viewtopic.php?t=189283