Free plan
SQL Query
Ask questions of data files with SQL and get a new table
About this tool
SQL is a standard language for asking questions of tables of data. This tool runs one SQL SELECT line over your files, which act as tables. You can filter, group, total, sort and join them. Your files are not changed. The answer is a new table.
For example, you list the ten biggest orders from a CSV file.
How to use it
- Choose this tool.
- Add one or more data files with Upload or drag and drop.
- Type your SQL SELECT line, using the table names shown for your files.
- Choose the format of the result, then press Generate.
- Download the result table.
What you get back
You get a new table with the answer to your question. Download it.
GOOD TO KNOW
One or more files in, one result out. to=json returns the rows inline ({data}); every other format returns a signed download URL. The files are loaded into a temporary in-memory database that only this request can see and that is discarded afterwards; nothing is stored between requests. `tables` may also be sent as a JSON array. Dates are compared as ISO text (2026-03-31T00:00:00.000Z), true/false as 1/0. At most 1,000,000 input rows per request and 200,000 result rows (more -> truncated: true).
TEST IT LIVE
Try SQL Query in the Studio
One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Family
Data
Plan
Free
Method
POST
Endpoint
/v1/data/query
Tool ID
data.query
Authentication
API key
Accepts
XLSX, ODS, MD, HTML, XLS, CSV +9 more
Background jobs
Yes
Usage group
Data
For developers
Use it from your code
cURL
curl -X POST "https://app.h2i.davixlabs.io/v1/data/query" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'files=@document.pdf' \
-F 'query=SELECT country, COUNT(*) AS orders FROM t1 GROUP BY country' \
-F 'tables=orders,customers' \
-F 'to=xlsx'Node.js
const { DavixH2I } = require('@davixlabs/h2i-sdk');
const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.data.query({
"files": 'document.pdf',
"query": "SELECT country, COUNT(*) AS orders FROM t1 GROUP BY country",
"tables": "orders,customers",
"to": "xlsx"
});
console.log(result.data, result.requestId);PHP
<?php
require 'vendor/autoload.php';
$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->data()->query([
'files' => 'document.pdf',
'query' => 'SELECT country, COUNT(*) AS orders FROM t1 GROUP BY country',
'tables' => 'orders,customers',
'to' => 'xlsx',
]);
echo $result->requestId;Documentation
Guides that use this tool
More in Data
