But did you know that you can use a simpler and still powerful alternative on the terminal?
To be fair, Postman and Insomnia offer more features like automated testing, workspaces, designing & mocking interfaces, etc.
But these are not features I regularly use. I need to make API requests, and for that the terminal suffices.
For Arch Linux:
yay -S curlie
Or other ways.
jq is a command-line JSON parser. It’s useful for formatting json, one of the most common formats for API data.
yay -S jq
Synopsis of curlie:
curlie [CURL_OPTIONS...] [METHOD] URL [ITEM [ITEM]]
You can pipe the output of curlie to other commands:
curlie -v https://api.spacexdata.com/v3/launches/ | jq -C | less -R
Here we do a GET request to the SpaceX API. We pipe the output to
jq -C to pretty print the json response with terminal colors.
Then we use a pager to get the output one “page” at the time, because it’s quite a lot of data.
More JSON on the Command Line⌗
This guide by George Ornbo will show you how to use jq in detail: JSON on the command line with jq.