SQL
query.execute
Run a saved query
Details
- Endpoint
- POST /v1/query/:query_id/execute
- Credits
- varies
- Pricing
- Depends on the input and the size of the result. The description says how.
- Rate class
- Heavy. Counts against your heavy requests per second.
- Also called
- /api/v1/query/:query_id/execute
Runs a saved query with its saved parameter defaults, overridden by query_parameters ({ name: value } or [{ key, value }]). Returns an execution_id to poll like sql.execute; with wait_ms (max 30000) it waits and returns the status. Credits are charged to the caller: 20 plus 1 per 50 MB read; max_age reuses a recent identical run for 2.
Parameters
| Name | Type | Description |
|---|---|---|
| query_idrequired | integer | |
| query_parameters | object | |
| max_age | integer | |
| wait_ms | integer | |
| performance | string |
Request
Send your key in the x-api-key header, or leave it out to use the keyless tier.
curl
curl -X POST "https://api.tide.ad/v1/query/1/execute" \
-H "x-api-key: YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{}'TypeScript
const res = await fetch("https://api.tide.ad/v1/query/1/execute", {
method: "POST",
headers: {
"x-api-key": process.env.TIDE_API_KEY!,
"content-type": "application/json",
},
body: JSON.stringify({}),
});
const data = await res.json();Response
No example response is available for this method yet.