Converts nested JSON objects into flat key-value pairs using dot notation. Access via MCP in Cursor or Windsurf, or call GET /v1/json/flatten with your JSON payload. Perfect for processing complex API responses or preparing data for databases that don't handle nested structures. Returns deterministic flattening with configurable separators.
curl "https://tinyfn.io/v1/json/flatten" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/json/flatten', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/json/flatten',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's json tools:
{
"mcpServers": {
"tinyfn-json": {
"url": "https://tinyfn.io/mcp/json",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Nested objects become dot-separated keys like 'user.profile.name', while arrays use bracket notation like 'items[0].value' or numeric indices depending on configuration.
Yes, you can specify custom separators instead of the default dot notation, useful when integrating with systems that have key naming restrictions.
MCP tools process JSON flattening deterministically regardless of size, though very deep nesting may hit practical limits depending on the AI agent's context window.
Null values are preserved as null in the flattened output, while empty objects and arrays can be optionally included or omitted based on configuration.
Yes, flattened JSON using standard dot notation can typically be reconstructed, though some edge cases with special characters in keys may require careful handling.
Get your free API key and start using Flatten Json in seconds.
Get Free API Key