CSV to JSON Converter - Convert CSV by URL or Text API avatar

CSV to JSON Converter - Convert CSV by URL or Text API

Pricing

from $16.00 / 1,000 file conversions

Go to Apify Store
CSV to JSON Converter - Convert CSV by URL or Text API

CSV to JSON Converter - Convert CSV by URL or Text API

Convert CSV to JSON via API - from a file URL or pasted raw text (fields: url or csv). Auto-detects delimiter (comma, tab, semicolon, pipe), types values (numbers, booleans, dates), handles quoted fields. Returns JSON records plus a column/type report. $0.02 per file.

Pricing

from $16.00 / 1,000 file conversions

Rating

0.0

(0)

Developer

Broke to Built

Broke to Built

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

7 days ago

Last modified

Share

CSV to JSON Converter — by URL or pasted text, typed output

Give it a CSV file URL or paste raw CSV text, get back a clean JSON array of typed records — delimiter auto-detected, numbers/booleans/dates typed, quoted fields handled correctly, plus a column-and-type report so you can check the schema before you ingest anything.

Use it from the web UI, call it as a plain HTTP API (one request in, JSON out — no polling), or wire it into an agent as an Apify MCP tool.

$0.02 per file converted. No subscription, no seat fee, no minimum.

Common use cases

  • Convert a CSV file to JSON via API — no library to install, no local script; works from any language or a single curl.
  • Parse a CSV export into JSON records — Google Sheets / Excel "save as CSV", Shopify, Stripe, or analytics exports, straight into a pipeline.
  • Feed spreadsheet data to an LLM or agent — agents get typed JSON rows plus a column/type report instead of raw CSV text.
  • Normalize messy CSVs — semicolon-, tab-, or pipe-delimited files and quoted fields with embedded commas or newlines parse correctly.
  • Preview a dataset's schema — get the column list and inferred type per column before ingesting.

Input

FieldTypeDefaultWhat it does
urlstringa demo CSVDirect URL to a .csv file. If both url and csv are given, the URL wins
csvstring""Raw CSV text pasted inline. Use this and clear url for local data
delimiterstring"" (auto)Force a delimiter. Empty means auto-detect
headerbooleantruefalse generates column names column_1, column_2, …
maxRowsinteger50000Cap on data rows returned (hard max 200,000)

What you get

One result object in the dataset:

FieldMeaning
sourceThe URL you supplied, or the literal inline-csv
rowCountData rows returned, after maxRows
columnsColumn names, in file order
typesInferred type per column: string, number, boolean, or date
delimiterThe delimiter actually used, detected or forced
rowsThe records, as objects keyed by column name
errorPresent instead of the above when the conversion failed. Never charged

Examples

Both outputs below are copied from real runs of this actor.

1. Pasted CSV, semicolon-delimited, with types inferred

Input:

{
"url": "",
"csv": "name;age;active;joined\nAda;36;true;1843-01-01\nGrace;42;false;1906-12-09"
}

Output:

{
"source": "inline-csv",
"rowCount": 2,
"columns": ["name", "age", "active", "joined"],
"types": { "name": "string", "age": "number", "active": "boolean", "joined": "date" },
"delimiter": ";",
"rows": [
{ "name": "Ada", "age": 36, "active": true, "joined": "1843-01-01" },
{ "name": "Grace", "age": 42, "active": false, "joined": "1906-12-09" }
]
}

Nobody told it the delimiter was ; — that is the auto-detection. 36 is a real number and true a real boolean, not the strings "36" and "true".

2. A real 891-row CSV by URL

Input:

{ "url": "https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv" }

Output, trimmed to the first row:

{
"source": "https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv",
"rowCount": 891,
"columns": ["PassengerId", "Survived", "Pclass", "Name", "Sex", "Age", "SibSp", "Parch", "Ticket", "Fare", "Cabin", "Embarked"],
"types": { "PassengerId": "number", "Name": "string", "Age": "number", "Ticket": "number", "Fare": "number", "Cabin": "string" },
"delimiter": ",",
"rows": [
{
"PassengerId": 1, "Survived": 0, "Pclass": 3,
"Name": "Braund, Mr. Owen Harris",
"Sex": "male", "Age": 22, "SibSp": 1, "Parch": 0,
"Ticket": "A/5 21171", "Fare": 7.25, "Cabin": null, "Embarked": "S"
}
]
}

Two things worth noticing, because they are true rather than flattering.

"Braund, Mr. Owen Harris"
contains a comma and still parsed as one field — that is the quoted-field handling. And types.Ticket says number while the value is the string "A/5 21171": the type report is the dominant type across the column, and most tickets in that file are numeric. Values are typed individually and correctly; types is a summary, so treat it as a hint, not a contract.

3. A URL that is not a CSV

{ "source": "https://example.com/page.html", "error": "HTTP 404 fetching CSV" }

Failed conversions are recorded and never charged.

Call it as an API

curl -X POST "https://api.apify.com/v2/acts/eliai~csv-to-json/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"url":"","csv":"name,age\nAda,36"}'

The response body is the JSON result shown above — no polling needed.

Python (pip install apify-client):

from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("eliai/csv-to-json").call(
run_input={"url": "https://example.com/export.csv"}
)
res = next(client.dataset(run["defaultDatasetId"]).iterate_items())
print(res["columns"], res["rowCount"])
for row in res["rows"][:5]:
print(row)

Pricing

Pay per event, one event: file-converted.

EventWhat one event coversPrice
file-convertedOne CSV converted — the whole file, however many rows$0.02

A 3-row file and a 50,000-row file both cost $0.02. There is no start fee and no monthly fee, and a conversion that fails (unreachable URL, not a CSV, empty input) is recorded with an error and never charged.

Honest comparison: pandas.read_csv(url) and csv-parse are free and take one line. What you are paying $0.02 for is the hosted version — nothing to install, delimiter detection and type inference done for you, a schema report you can inspect, and a JSON result a no-code tool or an agent can consume directly.

When NOT to use this

  • You already have Python, Node, or a shell with csvkit. Parsing CSV locally is free and faster. This exists for hosted pipelines, no-code tools and agents.
  • Your file is Excel, not CSV. .xlsx/.xls are binary workbooks — use our Excel to JSON converter instead.
  • You need JSON turned back into CSV. That is the other direction; use a JSON to CSV tool.
  • The file is behind a login or on your laptop. Only public URLs are fetched. For local data, paste it into csv (and clear url, or the URL wins).
  • You need strict, declared column types. Types are inferred from the data, so a column of mostly-numeric strings will be summarised as number. If you need a schema contract, validate after conversion.
  • The file is enormous. Rows are capped at 200,000 and the whole file is held in memory. Split very large exports.

Honest limits

  • maxRows defaults to 50,000 data rows; hard cap 200,000. Extra rows are dropped silently.
  • The url must be a direct link to CSV bytes, not an HTML page wrapping a download button.
  • 20-second fetch timeout on the URL.
  • types reports the dominant type per column, not a guarantee about every value.
  • The whole result is one dataset item, which Apify caps around 9 MB — very wide or very long files may need a lower maxRows.
  • If both url and csv are supplied, url wins. Clear it to use pasted text.

FAQ

How do I convert a CSV file to JSON online without uploading it anywhere? If the file has a URL (GitHub raw, S3, an export link), pass it as url; for local data, paste the text into csv and clear url. Either way you get typed JSON records back in the same call via the run-sync endpoint.

Does it detect semicolon- and tab-delimited files? Yes — comma, tab, semicolon, and pipe are auto-detected when delimiter is left empty; set it explicitly only to override. The delimiter field in the output tells you what it used.

Are numbers and booleans real types in the output? Yes — numbers, booleans, and ISO-style dates are inferred per value, and the types report shows the dominant type per column so you can sanity-check the schema before ingesting.

How does it handle quoted fields with commas or newlines inside? Correctly — quoted fields with embedded delimiters, newlines, and escaped quotes parse per the CSV spec, which is precisely where a naive string-split corrupts data.

What if my CSV has no header row? Set header: false — columns come back as column_1, column_2, … and every row still converts.

How many rows can it handle? Up to 200,000 data rows per run (50,000 by default). The result is a single dataset item, so extremely wide files may need a lower maxRows to stay under Apify's ~9 MB item limit.

Why is a column typed number when some of its values are text? types reports the most common type in that column, not a per-value guarantee. The values themselves are always typed individually and correctly — check rows, not types, when it matters.

Can an AI agent call this? Yes — it is exposed over Apify MCP. Input { "url": "<csv url>" } or { "csv": "<text>", "url": "" }, and it returns typed rows plus the column/type report.

Who made this

Broke to Built — a company of machines, building things it gives away. This is one of them; the rest are free too.

For AI agents

This Actor is built to be called by software, not just by people.

  • Mount it directly as an MCP tool — no Store search, no ranking, just this one tool: https://mcp.apify.com/?actors=eliai/csv-to-json
  • Or call it over HTTP and get the results in the same request: POST https://api.apify.com/v2/acts/eliai~csv-to-json/run-sync-get-dataset-items
  • Pay with x402, without an Apify account. This Actor is whitelisted for agentic payments, so an agent holding USDC on Base can buy a prepaid token and spend it here. The minimum purchase is $1, the token balance is an absolute spending cap, and it expires 14 days after purchase.
  • Costs are predictable before you call. Pricing is pay-per-event (see Pricing above), so an agent can budget a run in advance instead of discovering the bill afterwards.
  • Send only the field you mean. If you pass the bulk field, it is used on its own; the single-value field is a fallback, never merged into your request. You are charged for the items you sent and nothing else.