CSV to JSON
data.convert_csv_json
Overview
When you send CSV text or a file_ref, we parse RFC 4180 CSV into a JSON array or NDJSON with optional header mapping, null tokens, and per-column type coercion you declare in schema. We do not guess types or fetch remote files — do not send both csv and file_ref.
CSV quoting, delimiters, and nulls break naive splits. We parse deterministically.
Reliability
Same CSV and same options give the same JSON, every time. We never guess: a column you do not name in schema comes back as text, and a value that will not convert keeps its original text plus a warning rather than becoming null. Past 100,000 data rows we stop and say so in warnings, so check rowCount against what you sent. Both csv and file_ref are capped at 2 MiB. Nothing here is worth retrying unchanged: we refuse a delimiter that is not a single character or is a quote or newline, a schema type outside the six we accept, a nullValues array holding anything but strings, an outputMode other than array or ndjson, sending csv and file_ref together or neither, and CSV we cannot parse (reported as CSV_PARSE_ERROR — usually an unbalanced quote or the wrong delimiter).
Context footprint
Returns json (array or NDJSON string), rowCount, and optional warnings. A successful call costs 1 execution credit.
When to use it
When you have CSV and need structured JSON with declared types.
When you need heuristic type inference without a schema.
Scope
Non-goals
- Does not infer types without schema
- Does not fetch remote URLs
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
File limits
Constraints this skill applies to your input and generated files. The “Limited by” column shows the static source of each cap; none of these can be raised by upgrading your plan.
| Limit | Value | Limited by |
|---|---|---|
| Maximum size per input file | 2 MiB | Skill maximum |
How we handle your data
What this means
This skill may receive sensitive content and may return submitted, transformed, extracted, or reformatted content.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response may contain submitted or transformed content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| csv | string | No | Inline CSV text up to 2 MiB; required unless file_ref supplies the source. |
| file_ref | string | No | Tenant-scoped uploaded CSV reference; omit it when csv supplies inline text. |
| delimiter | string | No | Single non-quote, non-newline field delimiter; defaults to a comma when omitted. |
| hasHeader | boolean | No | Whether the first record supplies column names; defaults to true when omitted. |
| schema | object | No | Optional purpose-bound map of at most 10,000 column names to declared scalar types; omit it for string values. |
| mapping | object | No | Optional purpose-bound map of at most 10,000 source headers to output key strings; omit it to preserve headers. |
| nullValues | array | No | From 0 through 1,000 exact string tokens converted to JSON null; defaults to the empty string token. |
| outputMode | string | No | Whether rows return as array or ndjson output; defaults to array when omitted. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| ok | boolean | Yes | Always true for a successful conversion. |
| json | string | Yes | Converted data: an array of row objects or one NDJSON string. |
| rowCount | integer | Yes | Number of converted data rows. |
| warnings | array | No | From 1 through 100,010 warning strings; omitted when no conversion warning occurred. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"data.convert_csv_json","input":{"csv":"a,b\n1,x","schema":{"a":"integer"}}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("data.convert_csv_json", {"csv":"a,b\n1,x","schema":{"a":"integer"}});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not infer types without schema
- Does not fetch remote URLs
- Automatic type guessing
- Both csv and file_ref in one call
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "data.convert_csv_json",
"input": {
"csv": "a,b\n1,x",
"schema": {
"a": "integer"
}
}
}Examples
Coerce an integer column
{
"csv": "a,b\n1,x",
"schema": {
"a": "integer"
}
}{
"rowCount": 1,
"json": [
{
"b": "x",
"a": 1
}
],
"ok": true
}Emit NDJSON lines
{
"csv": "a,b\n1,x\n2,y",
"outputMode": "ndjson"
}{
"rowCount": 2,
"json": "{\"a\":\"1\",\"b\":\"x\"}\n{\"a\":\"2\",\"b\":\"y\"}",
"ok": true
}Recommended use cases
- Ingest spreadsheet exports into JSON pipelines
- Type-coerce CSV columns you name in schema
Avoid for
- Automatic type guessing
- Both csv and file_ref in one call
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.