curl --request GET \
--url https://api.dataville.com/api/v1/query.parquet \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.dataville.com/api/v1/query.parquet"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.dataville.com/api/v1/query.parquet', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dataville.com/api/v1/query.parquet",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.dataville.com/api/v1/query.parquet"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.dataville.com/api/v1/query.parquet")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dataville.com/api/v1/query.parquet")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body"<string>"{
"status": "error",
"code": "QUERY_INVALID",
"message": "Binder Error: Referenced column \"nope\" not found in FROM clause!"
}{
"status": "error",
"message": "Authentication required. Include your API key in the Authorization header."
}{
"status": "error",
"account_state": "authenticated",
"error": "insufficient_credit",
"data": {
"error": "<string>",
"code": "INSUFFICIENT_CREDIT"
},
"credits": {
"remaining_usd": 123,
"request_cost_usd": 123
}
}{
"status": "error",
"message": "<string>"
}{
"status": "error",
"message": "<string>"
}{
"status": "error",
"message": "<string>"
}{
"status": "error",
"message": "Export rate limit exceeded. Maximum 1,000 exports per day per account."
}{
"status": "error",
"message": "<string>"
}Run a SQL SELECT from DuckDB, result as Parquet
The same query as POST /api/v1/query — same tables, validator and
limits (10,000 characters, 1,000 rows, 30 seconds) — with the result
returned as a Parquet file, so DuckDB can read it directly:
SELECT * FROM read_parquet(
'https://api.dataville.com/api/v1/query.parquet?sql=SELECT%20title%2C%20url%20FROM%20wiki%20LIMIT%2010&token=YOUR_KEY'
);
The SQL runs on Dataville and only its result is returned; whole datasets cannot be downloaded.
Billing is the same as POST /api/v1/query: each row returned at
its source’s rate, so a query returning no rows costs nothing. DuckDB
reads one URL with several requests (a HEAD, then range GETs); the
first runs and charges the query, and every request for the same query
in the next 5 minutes is served the same result uncharged
(X-Dataville-Cached: true, X-Credit-Cost: 0). After that, reading it
again runs — and bills — the query again.
curl --request GET \
--url https://api.dataville.com/api/v1/query.parquet \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.dataville.com/api/v1/query.parquet"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.dataville.com/api/v1/query.parquet', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dataville.com/api/v1/query.parquet",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.dataville.com/api/v1/query.parquet"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.dataville.com/api/v1/query.parquet")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dataville.com/api/v1/query.parquet")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body"<string>"{
"status": "error",
"code": "QUERY_INVALID",
"message": "Binder Error: Referenced column \"nope\" not found in FROM clause!"
}{
"status": "error",
"message": "Authentication required. Include your API key in the Authorization header."
}{
"status": "error",
"account_state": "authenticated",
"error": "insufficient_credit",
"data": {
"error": "<string>",
"code": "INSUFFICIENT_CREDIT"
},
"credits": {
"remaining_usd": 123,
"request_cost_usd": 123
}
}{
"status": "error",
"message": "<string>"
}{
"status": "error",
"message": "<string>"
}{
"status": "error",
"message": "<string>"
}{
"status": "error",
"message": "Export rate limit exceeded. Maximum 1,000 exports per day per account."
}{
"status": "error",
"message": "<string>"
}Authorizations
A Dataville API key, sent as Authorization: Bearer dataville_.... Clients
that cannot set headers may pass the same key as ?token=.
Query Parameters
A single SELECT statement, URL-encoded (max 10,000 characters).
"SELECT title, url FROM wiki LIMIT 10"
Comma-separated ids of the caller's connected sheets to make available, as datasetIds in POST /api/v1/query.
API key as a query parameter, for clients that cannot set an
Authorization header (DuckDB WASM, the DuckDB CLI). Prefer the header
wherever possible — query strings end up in logs.
Response
The query result as a Parquet file. A Range request returns 206
with Content-Range.
Response headers
| Header | Example |
|---|---|
X-Credit-Cost | 0.045 (0 on a cached read) |
X-Credits-Remaining | 28.95 |
X-Dataville-Cached | false |
X-Dataville-Query-Id | 6654ea55-9e0f-49e4-a4da-78fe80b24c1d |
X-Dataville-Rows-Charged | 3 |
X-Dataville-Usage | {"rows_charged":3,"request_cost":0.045,"by_source":[{"source":"wiki","rows":3,"cost_per_row":0.015,"cost":0.045}]} |
The response is of type file.
Was this page helpful?