Response Handling
APIs return data in varied formats — JSON, XML, CSV, plain text — each with its own extraction toolchain. The patterns in this section are vendor-agnostic. They work against any API on the internet, whether you are scripting with curl or building automation with netapi.
What you will find here
- JSON Extraction with jq
-
Most modern APIs return JSON. jq is the standard tool for extracting, filtering, and reshaping JSON at the command line.
- XML Extraction
-
Legacy APIs (SOAP, Cisco MnT, many enterprise platforms) still return XML. xmlstarlet and yq handle the heavy lifting.
- Pagination Strategies
-
Any API returning collections will paginate. Offset, cursor, link-header, and keyset strategies each require different loop patterns.