JSON Flatten API - Convert Nested JSON to Dot-Notation Keys
Recursively flattens an object so every leaf value sits at the top level keyed by its dotted path. Array elements get numeric indices in the path. Empty objects and arrays are preserved as-is. The delimiter defaults to "." and can be customized.
Code examples
curl -X POST https://api.botoi.com/v1/json-extra/flatten \
-H "Content-Type: application/json" \
-d '{"json":{"user":{"name":"Ada","tags":["founder","engineer"]}},"delimiter":"_"}'When to use this API
Load nested JSON into CSV or spreadsheet
CSV rows are flat; JSON is nested. Flatten each record before writing to a spreadsheet; the dotted keys become column headers. Round-trip back to JSON with /v1/json-extra/unflatten.
Key-based feature flag config
Ship deeply nested feature-flag config, flatten it at runtime, and look up values by dotted key. Works well for LaunchDarkly-style targeting rules.
Diff-friendly serialization
Flat maps diff cleanly line-by-line; nested objects produce large change sets on a single modification. Flatten before committing to version control for clearer pull-request diffs.
Frequently asked questions
How are arrays represented?
What about keys that contain the delimiter?
Can I pass an array at the top level?
How are empty objects and arrays handled?
Is the flattened output ordered?
Get your API key
Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.