When an API returns a list (array), you can use bracket notation to select specific items: jq '.[0]' . Last Item: jq '.[-1]' . Range (e.g., first 5): jq '.[:5]' . 4. Downloading Data to a File

curl -s https://example.com | jq '.results' > filtered_data.json Use code with caution. Advanced Data Manipulation

The -s flag makes curl "silent," hiding the progress meter. The '.' is the , which tells jq to output the input exactly as is, but pretty-printed. 2. Extracting Specific Data Fields

is a CLI tool for transferring data over protocols like HTTP and HTTPS.

The most common way to use these together is by "piping" ( | ) the output of curl directly into jq . 1. Pretty-Printing JSON

If you only need a specific piece of information, such as a status message or a version number, you can specify the key: