If you want it in your actual preferred language, it's usually pretty easy to throw something together.
E.g. Ruby:
require 'json'
script = ARGV.pop
$J = JSON.parse(ARGF.read)
puts JSON.pretty_generate(eval(script))
Lets you do:
curl --silent https://api.vultr.com/v2/regions | ./jr '$J["regions"
].find{_1["id"]=="nrt"}'
To translate their example ( curl --silent https://api.vultr.com/v2/regions | rcl query
input.regions.key_by(r => r.id).nrt )
(... if you want to commit evil monkey-patching sins:
#!/usr/bin/env ruby
require 'json'
class Hash
def method_missing(sym) = (((r = self.dig(sym.to_s)) and return r) or super)
end
script = ARGV.pop
$J = JSON.parse(ARGF.read)
script = "$J#{script}" if script.start_with?(".")
puts JSON.pretty_generate(eval(script))
Now you can do:
curl --silent https://api.vultr.com/v2/regions | ./jr '.regions.find{_1.id =="nrt"}'
Or the more direct parallel:
curl --silent https://api.vultr.com/v2/regions | ./jr '.regions.group_by{_1.id}.nrt'
Since I used ARGF, you either need to quote the script or avoid spaces; you could explicitly use STDIN instead, in which case it's marginally safer to skip the quotes, at the cost of not being able to give a filename as the last argument
)