Convert CSV text, or a CSV at a public link, into a Parquet file. Types are inferred the same way as on the tool page.
POST /api/v1/tools/csv-to-parquet
Cost: 4 credits per successful request, taken from your account balance and shared by every token. A failed request is not charged.
Send exactly one of input (CSV text, up to 10 MB) or url (a public http(s) URL or s3://bucket/key, up to 25 MB). A successful response is the Parquet file itself, with Content-Type application/vnd.apache.parquet. Errors are JSON. Invalid CSV returns 400, and input over the limit returns 413.
Request body
| Field | Description |
|---|---|
input | The CSV text. Use this or url. |
url | A public http(s) URL or s3://bucket/key address of the CSV. Use this or input. |
region | AWS region for an s3:// address. Only with url. |
header | Whether the first row is a header. Default true. |
delimiter | auto, comma, semicolon, tab or pipe. Default auto. |
compression | SNAPPY or UNCOMPRESSED. Default SNAPPY. |
columnTypes | Object mapping a column name to string, int, double, boolean or timestamp, to override inference. |
Example
curl https://wapgee.com/api/v1/tools/csv-to-parquet \
-H "Authorization: Bearer wpg_your_token" \
-H "Content-Type: application/json" \
-o data.parquet \
-d '{"input":"id,name\n1,Ada\n2,Lin","compression":"SNAPPY"}'A successful call returns:
HTTP/1.1 200 OK
Content-Type: application/vnd.apache.parquet
Content-Disposition: attachment; filename="data.parquet"
(binary Parquet file)