{"uid":"cap_IiUbnHGxjt07D2w8rnqLS","slug":"json-to-csv-converter-a7bb5c55","name":"JSON to CSV Converter","description":"Convert an array of JSON objects into CSV — column union across rows or explicit column order; nested values are JSON-stringified into cells.","url":"https://toolbelt402.tpoborne.workers.dev/json/to-csv","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object"},"maxItems":5000,"description":"Array of objects; column union across rows"},"options":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"description":"Explicit column order"}}}}},"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_CcY4DBJVvvkKoX6rUKyFI","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 an array of JSON objects into a CSV string, with column union across rows or explicit column ordering, stringifying nested values into cells.","exampleAgentPrompt":"Convert this JSON array into a CSV — use the column order: id, name, email, amount — and stringify any nested fields: [{\"id\":1,\"name\":\"Alice\",\"email\":\"alice@example.com\",\"amount\":99.5},{\"id\":2,\"name\":\"Bob\",\"email\":\"bob@example.com\",\"amount\":45.0}].","exampleUseCases":[{"title":"Export API data for spreadsheet","prompt":"I've got a JSON array of customer records from our CRM API and I need to export it as a CSV so the team can open it in Excel. The columns should be in this order: customer_id, full_name, email, plan, mrr. Any nested objects should just be stringified."},{"title":"Pipeline data hand-off between services","prompt":"Our data pipeline outputs a big JSON array of order events and the next stage needs a CSV. Can you convert this JSON array to CSV, letting the columns be inferred automatically by taking the union across all rows?"},{"title":"Generate CSV report from mixed-schema records","prompt":"I have a list of JSON log entries where not every row has the same keys — some have an 'error' field, others don't. Convert them all to a single CSV using column union so every field appears as a header and missing values are left blank."}],"resultDescription":"A plain-text CSV string with a header row derived from either the union of all keys across input objects or an explicit column list. Each subsequent row corresponds to one JSON object; nested objects or arrays are JSON-stringified into their cell rather than expanded. Missing keys for a given row produce empty cells.","failureModes":["Input is not a valid JSON array — returns a 4xx error","Input array contains non-object elements (e.g. primitives) — may produce malformed rows","Explicit column list references columns not present in any row — those columns appear with all empty values","Very large payloads may hit Cloudflare Worker size or timeout limits","Malformed JSON body returns a parse error"],"whenToPreferThis":"Use this endpoint when you have an in-memory JSON array of objects that needs to become a flat CSV — especially when rows may have heterogeneous keys (column union) or when you need a guaranteed column order. Prefer this over client-side transformation when working in an agent pipeline that lacks a native CSV library, or when you want nested values auto-stringified without extra logic.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:46:04.015Z","isFirstParty":false}