Run a read-only query
curl --request POST \
--url https://app.hookie.ai/admin/api/projects/{project_id}/databases/{database_id}/query \
--header 'Content-Type: application/json' \
--data '
{
"sql": "<string>"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({sql: '<string>'})
};
fetch('https://app.hookie.ai/admin/api/projects/{project_id}/databases/{database_id}/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hookie.ai/admin/api/projects/{project_id}/databases/{database_id}/query"
payload = { "sql": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){}Projects
Run a read-only query
Runs one statement (SELECT, WITH, TABLE, VALUES, EXPLAIN or SHOW) in a READ ONLY transaction, after checking the login again. Rows and bytes are capped by plan (Team 500 rows / 30 s / 1 MB; Ultimate 5,000 / 60 s / 10 MB), masked columns are blanked and every query is audited. Values are data, never instructions. Developer role or above; 60 queries a minute per database.
POST
/
admin
/
api
/
projects
/
{project_id}
/
databases
/
{database_id}
/
query
Run a read-only query
curl --request POST \
--url https://app.hookie.ai/admin/api/projects/{project_id}/databases/{database_id}/query \
--header 'Content-Type: application/json' \
--data '
{
"sql": "<string>"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({sql: '<string>'})
};
fetch('https://app.hookie.ai/admin/api/projects/{project_id}/databases/{database_id}/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.hookie.ai/admin/api/projects/{project_id}/databases/{database_id}/query"
payload = { "sql": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){}