jq is a lightweight command-line tool for parsing and formatting JSON data. We can use this tool to extract the data based on the keys used and can limit the number of objects displayed.

To download the jq Tool visit https://stedolan.github.io/jq/

If you are on Windows, you can download the executable file and can set it up to the PATH variable so you could access the command from any where in the system.

To display the version

$ jq –version

To parse the JSON data

$ curl https://jsonplaceholder.typicode.com/posts | jq ‘.’

To display first JSON object

$ curl https://jsonplaceholder.typicode.com/posts | jq ‘.[0]’

To extract and display two JSON objects

$ curl https://jsonplaceholder.typicode.com/posts | jq ‘.[1:3]’