wk-j / json-path

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Json Path

Extract data from json with json path

Actions NuGet NuGet Downloads

Installation

dotnet tool install -g wk.JsonPath

Extract data from file

cat resource/input.json | wk-json-path '$.data[*].content[*].id'
719114
719118

cat resource/input.json | wk-json-path '$.data[0].content[0].id'
719114

Extract data from API

http -b 'https://reqres.in/api/users?page=2' \
    | wk-json-path "\$.data[?(@.last_name == 'Lawson')].email"

michael.lawson@reqres.in

http -b 'https://reqres.in/api/users?page=2' \
    | wk-json-path "\$.data[*].email"

michael.lawson@reqres.in
lindsay.ferguson@reqres.in
tobias.funke@reqres.in
byron.fields@reqres.in
george.edwards@reqres.in
rachel.howell@reqres.in

About


Languages

Language:F# 100.0%