{"uid":"cap_nnAR7UBaF2MdRkNTcy0pi","slug":"json-flatten-ce2ee218","name":"JSON Flatten","description":"Flatten a nested JSON document into single-level dotted-path keys.","url":"https://x402.agentindex.world/json/flatten?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","properties":{"data":{"title":"Data"},"separator":{"type":"string","title":"Separator","default":"."}}},"responseSchema":{"type":"json","example":{"flattened":{"a.b":1,"a.c.0":2,"a.c.1":3}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_QbMyC5lqJNYev1_A1QYcd","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Flattens a nested JSON object into a single-level dictionary with dot-separated (or custom separator) keys","exampleAgentPrompt":"Can you flatten this nested JSON object into a single-level dictionary using dot notation? The object is: {\"a\": {\"b\": 1, \"c\": [2, 3]}}","exampleUseCases":[{"title":"Normalize API response for CSV export","prompt":"I got this deeply nested JSON back from an API — can you flatten it into a single-level key-value structure using dot notation so I can drop it into a spreadsheet? Here's the JSON: {\"user\": {\"name\": \"Alice\", \"address\": {\"city\": \"NYC\", \"zip\": \"10001\"}}}"},{"title":"Flatten config file for environment variables","prompt":"Take this nested config object and flatten it for me using underscores as the separator so I can use it as environment variable names: {\"db\": {\"host\": \"localhost\", \"port\": 5432}, \"app\": {\"debug\": true}}"},{"title":"Prepare nested data for flat key-value store","prompt":"I need to store this nested JSON in a flat key-value store. Can you flatten it using dot notation? {\"metrics\": {\"cpu\": {\"usage\": 0.85, \"cores\": 8}, \"memory\": {\"used\": 4096, \"total\": 16384}}}"}],"resultDescription":"Returns a flattened object where all nested keys are collapsed into a single level, with each key being the full path from root to leaf joined by the specified separator (default '.'), and array indices represented numerically. Example: {\"a\": {\"c\": [2,3]}} becomes {\"a.c.0\": 2, \"a.c.1\": 3}.","failureModes":["Missing or non-object 'data' parameter may return an error or empty result","Circular references in the input JSON may cause infinite loops or errors","Very deeply nested structures may hit processing limits","Invalid JSON input that cannot be parsed will return an error"],"whenToPreferThis":"Choose this endpoint when you need a quick, pay-per-call utility to flatten nested JSON without setting up any local libraries or infrastructure. Ideal for agents that occasionally need to normalize JSON as part of a larger workflow, especially when already operating in the x402/USDC micropayment ecosystem on Base. Good for one-off transformations where installing a flattening library is overkill.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-31T00:35:54.017Z","isFirstParty":false,"canonicalSlug":"json-flatten-ce2ee218"}