How to Flatten Nested JSON From an API Into Columns
API responses are often nested. Here is how to turn them into one flat table.
A typical API response wraps the records inside other objects: a status field, a data object, then a list of users, and inside each user an address object. A spreadsheet has no place for that structure, so it has to be flattened.
Flattening gives every nested value its own column, named by its path. An address with a city and a country becomes address.city and address.country. Lists of simple values are kept as text in one cell, so no data is lost. Records with different fields get empty cells where a field is missing.
Many responses contain more than one list, for example users and a list of plans. API Response to Table finds the lists inside the response, shows how many records each has, and picks the biggest by default. Use the list picker to switch. The table shows the first 10 records so you can check the columns, and the download contains all of them.
Once you have the table, you can trim spaces, join it with another file, mask personal columns or profile its quality with the other Data Utility tools, and Data Lineage records each step.
Open the API Response to Table
Related tool pages
- JSON API Response to CSV: Turn the JSON from an API into a CSV file. Nested fields become columns and you pick which list to use. Free, in your browser, with an optional token.
How to use the API Response to Table: step by step
- Open API Response to Table and send your request.
- If there are several lists, choose the one you want.
- Check the flattened columns in the preview.
- Download the table.
When to use the API Response to Table
- Turn a nested API response into a CSV
- Choose one list from a response that has several
- Prepare JSON for a pivot table
- Load API data into a database
Example
Input: GET https://api.example.com/users + Bearer token
Output: id,name,address.city 1,Ada,London
Frequently asked questions
How does the token work?
Choose Bearer token, API key in a header, or username and password, and paste the value. It is sent only to the API you call, kept in memory, and never saved or written to Data Lineage.
What if the API blocks the request?
Some APIs do not allow calls from other websites (CORS), so the browser blocks the request. Use an API that allows browser access, or ask its owner to enable CORS.
What happens to nested fields?
Nested objects are flattened into columns such as address.city. If the response has several lists, you can choose which one becomes the table.
Is it safe to use a token in API Response to Table?
Your token goes only to the API you call, straight from your browser. Data Utility never receives it or the response. It is kept in memory for that request, not saved, and not written to Data Lineage. Use a token with read-only access when you can.
Tip: Column names show the full path, so address.city is easy to find after flattening.