In reply to .
Mark D and I love jq for quick json processing via the command line.
One utility script we use often is generating a list of all sites connected to our account from the WordPress.com API:
curl -sH 'Accept: application/json' -H 'Authorization: Bearer [REDACTED]' https://public-api.wordpress.com/rest/v1.1/me/sites | jq -r '.sites[] | .URL' > sites.txt
A couple helpful tips we’ve found:
- use
-r(raw) to remove quotes around the data. - Use
| @shfor transforming arrays into space separated strings
We also combine it with sqlite-utils to stuff certain subsets of json data we get back from APIs (like Zoho) into a sqlite database for analysis in Metabase.

Leave a Reply