Run SQL on CSV & Excel Files Online
Query CSV, XLSX and JSON files with SQL: SELECT, WHERE, JOIN, GROUP BY with SUM / COUNT / AVG, HAVING, ORDER BY and LIMIT. Results as JSON or CSV.
Result
Press “Run” to see the result.
Upload one or more tables as multipart files (CSV with any delimiter, XLSX, JSON array or JSON lines); each file becomes a table named after the file (orders.csv → orders) or after a custom field name. You can also send csv text (table t, or the name in table), data (JSON array) or tables {"name": rows | "csv text"}. Column types are inferred (numbers, booleans, text; empty cells are NULL; numbers with leading zeros such as phone numbers stay text).
Supported SQL: SELECT [DISTINCT] columns, *, t.*, expressions and aliases; FROM with [INNER] JOIN / LEFT JOIN … ON (equality joins use a hash join) and comma / CROSS JOIN; WHERE with AND / OR / NOT, comparisons, LIKE (case-insensitive, % and _), IN, BETWEEN, IS [NOT] NULL; GROUP BY with COUNT(*), COUNT(DISTINCT), SUM, AVG, MIN, MAX, TOTAL, GROUP_CONCAT; HAVING; ORDER BY columns, aliases or positions with ASC / DESC and NULLS FIRST / LAST; LIMIT / OFFSET; CASE, CAST and functions LOWER, UPPER, LENGTH, TRIM, SUBSTR, REPLACE, INSTR, CONCAT, ROUND, ABS, FLOOR, CEIL, COALESCE, IFNULL, NULLIF, DATE, YEAR, MONTH, DAY and UNACCENT (removes Vietnamese diacritics). Subqueries, UNION and window functions are not supported.
Output JSON (columns, rows, counts) or format=csv. Limits: 200,000 rows per table, 5,000,000 cells in total, 10,000 result rows (max_rows), 8 seconds per query; nothing is stored.
Use this in your code
curl -X POST "https://apibox.io.vn/v1/csv-query" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file1=@./my-file"const form = new FormData();
form.append('file1', fileInput.files[0]);
const res = await fetch('https://apibox.io.vn/v1/csv-query', {
method: 'POST',
headers: { Authorization: 'Bearer YOUR_API_KEY' },
body: form,
});
console.log(await res.json());import requests
res = requests.post(
"https://apibox.io.vn/v1/csv-query",
headers={"Authorization": "Bearer YOUR_API_KEY"},
files={"file1": open("my-file", "rb")},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/csv-query');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
CURLOPT_POSTFIELDS => ['file1' => new CURLFile('my-file')],
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));API documentation → Get a free API key
FAQ
How are tables named?
After the uploaded file name without extension (Đơn hàng.csv → Đơn_hàng), or after the multipart field name if it is not file / file1…; in JSON use the keys of tables. A single table can also be called t.
Does it support JOIN?
Yes: INNER JOIN and LEFT JOIN with any ON condition, plus comma / CROSS joins. Equality joins (a.id = b.id) are fast hash joins; other conditions compare row pairs up to 5 million.
Is LIKE case-sensitive?
No. LIKE ignores case for all letters, including Vietnamese (Áo matches áo%). Use UNACCENT() to also ignore diacritics: WHERE UNACCENT(name) LIKE '%nguyen%'.