QuestDB provides a REST API over HTTP for executing SQL queries, importing data, and exporting results. The API is stateless and uses standard HTTP methods.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/questdb/questdb/llms.txt
Use this file to discover all available pages before exploring further.
Base URL
The REST API is available at:0.0.0.0:9000. You can configure this in server.conf:
Available Endpoints
| Endpoint | Method | Description |
|---|---|---|
/exec | GET | Execute SQL queries and retrieve results as JSON |
/exp | GET | Export query results as CSV or Parquet |
/imp | POST | Import CSV data into tables |
Authentication
By default, the REST API does not require authentication. You can enable HTTP Basic authentication inserver.conf:
Response Format
All API responses use standard HTTP status codes:| Status Code | Description |
|---|---|
200 | Success |
400 | Bad Request - invalid query or parameters |
403 | Forbidden - authorization error |
500 | Internal Server Error |
Success Response
Successful queries return JSON with this structure:Error Response
Errors return JSON with position and message:position field indicates the character offset where the error occurred.
Connection Limits
You can configure connection limits per endpoint inserver.conf:
-1 means no specific limit for that endpoint (limited only by the total connection limit).
Query Timeout
Set query timeout using theStatement-Timeout header (in milliseconds):
URL Encoding
Always URL-encode query parameters, especially SQL queries:Next Steps
Query Endpoint
Execute SQL queries with
/execImport Endpoint
Import CSV data with
/impExport Endpoint
Export data with
/exp