# JSON Array to NDJSON Converter

> JSON Array to NDJSON Converter is a paid API for AI agents from toolshed.lemon-agent.dev, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Converts a JSON array into Newline Delimited JSON (NDJSON), emitting one compact JSON value per line; rejects non-array inputs explicitly.

## Facts

- Endpoint: POST https://toolshed.lemon-agent.dev/convert/json-ndjson
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/json-array-to-ndjson-converter-5b785916
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_PYtOdDymMO5J9tuehpj0v

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability json-array-to-ndjson-converter-5b785916 -d '<json body>'
```

Example prompt: I have a JSON array of user records and I need it converted to NDJSON — one compact JSON object per line — so I can pipe it into my log shipper. Can you run the conversion?

## When to prefer this

Use this endpoint when you need to reliably convert a JSON array into NDJSON and want strict validation that the input is actually an array (not silently wrapping a single object). Prefer it over generic format converters when your downstream consumers are streaming loaders, log shippers, or jq pipelines that require the NDJSON line-per-record format. It pairs naturally with the sibling NDJSON-to-JSON-array endpoint for round-trip workflows.

## Known failure modes

- Non-array JSON input (object, string, number) is rejected with an error — the endpoint does not treat it as a single-element stream
- Input exceeds 256 KB limit — request is refused
- Malformed JSON that cannot be parsed returns an error
- Empty array may return an empty response body

## How this service works

JSON array to NDJSON. POST a JSON array; the response is one compact JSON value per line — the shape streaming loaders, log shippers and jq pipelines take. A non-array input is refused rather than emitted as a stream of one, because that is the mistake this endpoint exists to catch.

## Output

A plain-text response in application/x-ndjson format where each line is a single compact JSON value from the original array. If the input is not a JSON array, the request is rejected with an error rather than emitting a single-line stream.

## Request schema (JSON Schema)

```json
{
 "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 JSON 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/x-ndjson",
     "description": "the converted NDJSON file as the response body (application/x-ndjson)"
    },
    "example": {
     "type": "string",
     "description": "the sample request body above, converted — what a the converted NDJSON file as the response body (application/x-ndjson) looks like"
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/json-array-to-ndjson-converter-5b785916/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from toolshed.lemon-agent.dev](https://www.zero.xyz/host/toolshed.lemon-agent.dev/llms.txt)
