Turn an API response into a table
This guide takes you from a web address to a CSV file: you fetch a JSON response, show its array as a table, filter it to the rows you want, count a column’s values, and save the rows. The steps use JSONPlaceholder, a free test API whose /todos endpoint returns 200 to-do items.
Before you start
Section titled “Before you start”You need a network connection. The response opens read-only; see Work with a pasted or fetched document.
Fetch the response
Section titled “Fetch the response”-
Press Ctrl+U, or choose File → Fetch from URL….
-
In URL, type
https://jsonplaceholder.typicode.com/todos. Leave the method onGET. -
Select Fetch, or press Ctrl+Enter.
The response opens in a new tab named todos, and a notice shows the HTTP status, HTTP 200, with the size of the response and the time the request took. The tree shows the root array, [200], already open: one object per to-do, each with userId, id, title, and completed.
If your API needs a token or headers, see Headers and authentication; to reuse a request from your browser, see Paste a cURL command.
Open the array as a table
Section titled “Open the array as a table”Select Table in the view switcher. The root of this response is an array, so the table shows it at once: one row per to-do, one column per key, and the footer reads “Records 1–100 of 200”. Use Next in the footer to see the next 100 rows.
Many APIs wrap the array in an object, for example { "data": [ … ], "page": 1 }. For those, right-click the array in the tree, here data, and choose View Array as Table. See Open an array as a table.
Filter and count the rows
Section titled “Filter and count the rows”-
Count a column’s values
Right-click a cell in the
completedcolumn and choose Value frequency of completed. The panel listsfalse110 andtrue90. -
Filter the rows
Click
falsein the panel. The table keeps the 110 open to-dos, and the footer reads “Records 1–100 · 110 matches of 200”.To filter by hand instead, see Filter rows.
-
Sort the rows
Click the
userIdheader to sort the open to-dos by user. Click it again to reverse the order.
Save the rows as CSV
Section titled “Save the rows as CSV”-
Select Export CSV in the footer.
-
Choose a file name, for example
open-todos.csv, and select Save.
The file has the visible columns and the rows that match the filter, in their current order, and a notice confirms “Exported 110 records”. Each cell holds the value itself, so a title reads delectus aut autem without JSON quotes. See Export a table as CSV.
To export full values with SQL:
-
Press Ctrl+E. The query bar opens on the SQL tab, where
docis the root array. -
Type this query and press Ctrl+Enter:
SELECT * FROM doc WHERE NOT completed ORDER BY userId -
Select Export every row, and choose a file name ending in
.csv.
For an array inside the response, right-click it and choose Query Array with SQL first. See SQL queries.
Next steps
Section titled “Next steps”- Table view: hide and pin columns, and group rows with totals
- Chart view: draw the same array as a bar, line, or pie chart
- Export types: generate TypeScript or other types for the response