Execute single SQL statement
curl --request POST \
--url https://api.hoox.sh/query \
--header 'Content-Type: application/json' \
--data '
{
"query": "SELECT * FROM trades WHERE symbol = ? LIMIT ?"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({query: 'SELECT * FROM trades WHERE symbol = ? LIMIT ?'})
};
fetch('https://api.hoox.sh/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hoox.sh/query"
payload = { "query": "SELECT * FROM trades WHERE symbol = ? LIMIT ?" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"requestId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"results": [
"<unknown>"
],
"lastRowId": 123,
"changes": 123
}{
"success": false,
"requestId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"error": "Invalid JSON payload structure."
}{
"success": false,
"requestId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"error": "Invalid JSON payload structure."
}{
"success": false,
"requestId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"error": "Invalid JSON payload structure."
}{
"success": false,
"requestId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"error": "Invalid JSON payload structure."
}Database
Execute single SQL statement
Internal endpoint on d1-worker. Executes a single parameterised
SQL statement against the D1 database. Only SELECT,
INSERT, UPDATE, DELETE, and REPLACE are allowed.
String literals and UNION are rejected.
POST
/
query
Execute single SQL statement
curl --request POST \
--url https://api.hoox.sh/query \
--header 'Content-Type: application/json' \
--data '
{
"query": "SELECT * FROM trades WHERE symbol = ? LIMIT ?"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({query: 'SELECT * FROM trades WHERE symbol = ? LIMIT ?'})
};
fetch('https://api.hoox.sh/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hoox.sh/query"
payload = { "query": "SELECT * FROM trades WHERE symbol = ? LIMIT ?" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"requestId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"results": [
"<unknown>"
],
"lastRowId": 123,
"changes": 123
}{
"success": false,
"requestId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"error": "Invalid JSON payload structure."
}{
"success": false,
"requestId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"error": "Invalid JSON payload structure."
}{
"success": false,
"requestId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"error": "Invalid JSON payload structure."
}{
"success": false,
"requestId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"error": "Invalid JSON payload structure."
}Body
application/json
Last modified on June 17, 2026
⌘I