curl --request GET \
--url https://api.dataville.com/api/v1/query.csv \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.dataville.com/api/v1/query.csv"
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.csv', 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.csv",
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.csv"
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.csv")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dataville.com/api/v1/query.csv")
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": "Export rate limit exceeded. Maximum 1,000 exports per day per account."
}Run a SQL SELECT from DuckDB, result as CSV
GET /api/v1/query.parquet with a CSV result, for read_csv or any
HTTP client. Same limits, billing and 5-minute uncharged re-reads.
SELECT * FROM read_csv('https://api.dataville.com/api/v1/query.csv?sql=SELECT%20name%2C%20version%20FROM%20pypi%20LIMIT%2010&token=YOUR_KEY');
curl --request GET \
--url https://api.dataville.com/api/v1/query.csv \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.dataville.com/api/v1/query.csv"
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.csv', 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.csv",
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.csv"
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.csv")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dataville.com/api/v1/query.csv")
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": "Export rate limit exceeded. Maximum 1,000 exports per day per account."
}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 CSV with a header row. Same headers as the Parquet form.
The response is of type string.
Was this page helpful?