Dumping an API response straight into Excel always ends the same way: hundreds of irrelevant columns, duplicate rows, and half an hour of manual cleanup. Do the shaping before the CSV exists.
Take a raw export like orders.json and keep only what the spreadsheet actually needs:
$ npx github:mahope/transmute orders.json --pipe '[ {"op":"filter","expr":"item.status === "shipped""}, {"op":"pick","fields":["id","customer","total"]}, {"op":"sort","by":"total","dir":"desc"} ]' --output csv id,customer,total 1039,Cara Vind,2199.99 1042,Alice Hansen,1299
What each step removed from the cleanup session:
filter — no more hiding cancelled orders in Excel filterspick — the sheet gets exactly the columns you chose, in ordersort — highest value first, before anyone opens itRe-running exports tends to duplicate rows. Dedupe by a business key on the way through:
$ cat customers.json | npx github:mahope/transmute --pipe '[{"op":"unique","by":"email"}]' --output csv
CSV is flat. Flatten nested objects deliberately with map rather than hoping a generic flattener guesses right:
$ npx github:mahope/transmute users.json --pipe '[ {"op":"map","expr":"({ name: item.name, city: item.address.city })"} ]' --output csv
The same transformations run in the browser on the Transmute demo page — paste JSON, click through the pipeline, copy the CSV out. Nothing leaves your machine.
The Transmute CLI is free (npx github:mahope/transmute). The desktop app adds an interactive pipeline builder, live preview and batch processing — one-time $19, no subscription.
More guides: XML to JSON · A simpler jq alternative