{"uid":"cap_K1jCEfPVWZ-1t1ddQ25DZ","slug":"ndjson-to-json-array-converter-d7c26202","name":"NDJSON to JSON Array Converter","description":"NDJSON to a JSON array. POST newline-delimited JSON; the response is a pretty-printed array of the parsed values. Blank lines are skipped and a line that does not parse is refused naming the 1-based line number — which is the reason to run a parser over a log file instead of wrapping it in brackets.","url":"https://toolshed.lemon-agent.dev/convert/ndjson-json","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"string","maxLength":262144,"description":"the raw NDJSON file as the request body, up to 256 KB"},"type":{"type":"string","const":"http"},"method":{"type":"string","const":"POST"},"bodyType":{"type":"string","const":"text"}},"additionalProperties":false},"output":{"type":"object","required":["type","format"],"properties":{"type":{"type":"string","const":"text"},"format":{"type":"string","const":"application/json","description":"the converted JSON file as the response body (application/json)"},"example":{"type":"string","description":"the sample request body above, converted — what a the converted JSON file as the response body (application/json) looks like"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_iYQF_QINUybY7ivu42Y8v","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts newline-delimited JSON (NDJSON) into a pretty-printed JSON array, skipping blank lines and rejecting malformed lines with a 1-based error indicator.","exampleAgentPrompt":"I have a log file in NDJSON format — each JSON object is on its own line — can you convert it into a regular pretty-printed JSON array for me?","exampleUseCases":[{"title":"Log file ingestion pipeline","prompt":"I've got a server log in NDJSON format with one JSON event per line. Can you convert the whole thing into a proper JSON array so I can feed it into my analytics tool?"},{"title":"Validate NDJSON before processing","prompt":"I'm not sure if my NDJSON export is clean — can you try converting it to a JSON array and tell me if any lines fail to parse, including which line number is broken?"},{"title":"Convert API streaming response to JSON","prompt":"I captured a streaming API response that came back as newline-delimited JSON. Can you convert those lines into a single pretty-printed JSON array I can inspect?"}],"resultDescription":"A pretty-printed JSON array containing each successfully parsed NDJSON value as an element. Blank lines are silently skipped. If any line fails to parse, the request is rejected with an error message identifying the 1-based line number of the offending line — no partial output is returned in that case.","failureModes":["Malformed JSON on any line causes full rejection with error indicating the 1-based line number","Input exceeds 256 KB limit results in rejection","Empty input body returns empty array or error","Non-text body type is refused"],"whenToPreferThis":"Use this endpoint when you need to reliably convert NDJSON (newline-delimited JSON) to a standard JSON array, especially for log files where you need strict per-line validation and clear error reporting on malformed lines. Prefer this over manual bracket-wrapping because it correctly handles blank lines, validates each record, and pinpoints exactly which line is broken.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-16T00:37:26.039Z","isFirstParty":false}