{"uid":"cap__ydwp1rQcxtXahfi2BFfl","slug":"api-strale-io-6bcd68a6","name":"Flatten JSON to Dot-Notation","description":"Flatten nested JSON to dot-notation keys. E.g. {a:{b:[1,2]}} → {'a.b.0':1,'a.b.1':2}. Configurable delimiter and array handling. Algorithmic.","url":"https://api.strale.io/x402/flatten-json?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","required":["data"],"properties":{"data":{"description":"Nested JSON object"},"delimiter":{"type":"string","description":"Default '.'"},"array_handling":{"type":"string","description":"'index' or 'stringify'"}}}},"additionalProperties":false}}},"responseSchema":null,"example":{"request":{"data":"{\"user\":{\"name\":\"Alice\",\"address\":{\"city\":\"London\"}},\"scores\":[10,20]}","delimiter":".","array_handling":"index"},"response":{"_meta":{"payment":{"method":"x402","price_usd":0.0216,"settlement_id":"0xd044917f7cbf33fac8965c27107f4b379abc501fe822e9f6de9f56b11eff9fe6"},"capability":"flatten-json","latency_ms":0,"provenance":{"source":"algorithmic","fetched_at":"2026-06-17T04:11:19.101Z"}},"delimiter":".","flattened":{"":"{\"user\":{\"name\":\"Alice\",\"address\":{\"city\":\"London\"}},\"scores\":[10,20]}"},"key_count":1,"array_handling":"index","max_depth_found":0}},"exampleRequest":{"data":"{\"user\":{\"name\":\"Alice\",\"address\":{\"city\":\"London\"}},\"scores\":[10,20]}","delimiter":".","array_handling":"index"},"tags":["x402"],"displayCostAmount":"0.0216","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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.0216/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0216","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0216","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_BmyO6SQd2UOBoLNz8Kro2","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0216","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 dot-notation key-value pairs, with configurable delimiter and array handling","exampleAgentPrompt":"Can you flatten this nested JSON object {\"user\":{\"name\":\"Alice\",\"address\":{\"city\":\"London\"}},\"scores\":[10,20]} into dot-notation keys using '.' as the delimiter and 'index' for array handling?","exampleUseCases":null,"resultDescription":"Returns a flat JSON object where each nested key path is represented as a dot-delimited string (e.g. 'user.address.city') mapped to its scalar value. Arrays are either indexed (e.g. 'scores.0', 'scores.1') or stringified depending on the array_handling option.","failureModes":["Missing required 'data' query parameter returns an error","Malformed or non-object JSON in 'data' causes a parsing error","Invalid 'array_handling' value (not 'index' or 'stringify') may return an error or use default behavior","Extremely deep or large nested objects may time out or hit size limits"],"whenToPreferThis":"Choose this endpoint when you need a simple, deterministic algorithmic transformation of a nested JSON object into flat dot-notation keys — especially useful for indexing into Elasticsearch, flattening config files, preparing data for CSV export, or normalizing API responses for storage. It supports configurable delimiters and array handling modes. Prefer this over writing custom flattening code when operating in an agentic pipeline that needs a reliable, stateless utility call.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-13T06:54:15.681Z","isFirstParty":false,"canonicalSlug":"api-strale-io-6bcd68a6"}