Convert Nested API JSON Response to CSV Spreadsheet

100% Private Report Issue

Select Files

or drag and drop files here

Upload a JSON file

The Challenge

REST APIs return nested JSON with objects inside objects, arrays of mixed types, and wrapper structures like { data: { results: [...] } }. Pasting this into a spreadsheet produces unusable single-cell output or [object Object] values. Developers and analysts waste time writing custom scripts to flatten each API's unique structure into tabular format.

How API response flattening works

REST APIs rarely return flat arrays. Most wrap data in pagination objects, nest related entities, and include arrays within records. This tool handles all of it automatically. It detects the main data array inside wrapper objects, then recursively flattens every nested object into dot-notation column names. A user record with address.street, address.city, and company.name becomes three separate spreadsheet columns — no data lost, no manual mapping required.

How to save an API response as JSON

  1. Browser: open DevTools Network tab, find the API request, right-click the response and select 'Copy response'. Paste into a text editor and save as .json
  2. cURL: run 'curl https://api.example.com/endpoint > response.json' to save directly to file
  3. Postman: send the request, click 'Save Response' and select 'Save as file'
  4. JavaScript: use fetch() and write JSON.stringify(data) to a file or copy from console.log output
  5. Python: use requests.get() and write response.json() to a file with json.dump()

Setting the correct root path

  • If your JSON is a plain array [...], leave root path empty — auto-detection handles it
  • If wrapped like { "data": [...] }, set root path to 'data'
  • If deeply wrapped like { "response": { "results": [...] } }, set root path to 'response.results'
  • If unsure, leave empty — the tool scans for the first array in the structure automatically
  • Incorrect root path shows 'Path not found' error — check your JSON structure and adjust

Handling different JSON structures

Simple arrays are flattened directly — each array element becomes one CSV row. Nested objects become dot-separated columns: user.address.city. Primitive arrays (tags, categories) are joined with semicolons into a single cell. Object arrays are indexed: items[0].name, items[1].name — each sub-object gets its own indexed columns. The pivot down mode creates a field-per-row layout instead, useful for inspecting complex single records or building data dictionaries.

Common API response patterns supported

  • Plain arrays: [ { }, { }, { } ] — auto-detected, no root path needed
  • Data wrapper: { "data": [ ... ] } — set root path to 'data'
  • Pagination wrapper: { "results": [...], "next": "..." } — set root path to 'results'
  • Nested wrapper: { "response": { "items": [...] } } — set root path to 'response.items'
  • Single object: { "id": 1, "name": "..." } — flattened to one-row CSV automatically
  • Mixed nesting: objects containing arrays containing objects — fully handled with indexed dot notation

Step-by-Step Workflow

01

Upload JSON API response file

02

Set root path if data is wrapped (e.g. data.results)

03

Review flattened columns in preview

04

Download as CSV or Excel

Specifications

Input Format
Any JSON file from REST API response (.json)
Array Detection
Auto-detects data arrays in nested wrappers
Root Path
Configurable — set to match your API structure (e.g. data.results, response.items)
Nested Handling
Dot-notation flattening (e.g. address.city, user.name)
Output Formats
CSV or Excel (.xlsx)
Processing
100% client-side — no data sent to servers

Best Practices

  • Leave root path empty for simple JSON arrays — auto-detection finds the data array in most API responses
  • Use dot notation for nested wrappers: data.users, response.results.items
  • Enable 'suppress line breaks' when API responses contain multi-line description fields
  • Pivot down mode is useful for inspecting a single complex API record field by field
  • Use semicolon delimiter if your data contains commas (common in address fields and descriptions)
  • All processing is client-side — safe for API responses containing authentication tokens or private data

Frequently Asked Questions

How do I convert a JSON API response to CSV?

Save your API response as a .json file, upload it here, and set the root path to point to your data array (e.g. 'data' or 'results'). The tool flattens all nested objects into columns and outputs a clean CSV. Download as CSV or Excel.

What happens to nested objects in the JSON?

Nested objects are flattened using dot notation. A record like { user: { name: 'John', address: { city: 'NYC' } } } becomes columns: user.name and user.address.city. No nesting depth limit — all levels are flattened.

Can this handle paginated API responses?

It handles single-page responses. For paginated APIs, you need to combine all pages into one JSON array first (concatenate the data arrays), then upload. The tool processes whatever array you provide regardless of size.

What if different records have different fields?

The tool creates columns for every unique field across all records. Records missing a field get empty cells in those columns. This is standard CSV behavior — no data is lost from records with extra or fewer fields.

Is my API data safe?

Yes. Processing runs entirely in your browser. No data is uploaded to any server. This is important for API responses that may contain API keys, tokens, personal data, or proprietary business information.

Related Guides