API Reference
Query your data programmatically via REST API.
Authentication
rawquery supports two authentication methods for API access.
Getting an API Key
Create a key via the CLI or the dashboard:
rq api-keys create --name my-keyrq api-keys create --name my-keyOr go to Settings > API Keys in the dashboard and click Generate API Key.
Copy the key (starts with rq_). To revoke: rq api-keys revoke <key-id> or delete it from Settings > API Keys.
X-API-Key header (recommended for scripts)
For the Execute API, use the X-API-Key header:
X-API-Key: rq_your_api_key_hereX-API-Key: rq_your_api_key_hereBearer token
For workspace and dashboard endpoints, API keys also work as Bearer tokens:
Authorization: Bearer rq_your_api_key_hereAuthorization: Bearer rq_your_api_key_hereBase URL
https://api.rawquery.dev/api/v1https://api.rawquery.dev/api/v1Full interactive reference with schemas and "Try it out": api.rawquery.dev/api/docs
OpenAPI spec (JSON): api.rawquery.dev/api/openapi.json
Rate Limits
| Plan | Queries/min |
|---|---|
| Free | 10 |
| Team | 60 |
| Business | 100 |
Free tier: 10 requests/min. Exceeding this returns 429 Too Many Requests. Upgrade to Team or Business for higher limits.
Error Handling
Errors return appropriate HTTP status codes with a JSON body:
{ "detail": { "error": { "code": "SYNTAX_ERROR", "message": "Syntax error at line 1: unexpected token 'FORM'", "hint": "Check your SQL syntax. rawquery uses Postgres-compatible SQL." } }}{ "detail": { "error": { "code": "SYNTAX_ERROR", "message": "Syntax error at line 1: unexpected token 'FORM'", "hint": "Check your SQL syntax. rawquery uses Postgres-compatible SQL." } }}Access the error in code: response.json()["detail"]["error"]["code"].
| Status | Meaning |
|---|---|
400 | Bad request (invalid SQL, missing params) |
401 | Unauthorized (invalid, missing, or expired API key) |
403 | Forbidden (valid key, but no access to this workspace or resource) |
408 | Query timeout (30s limit) |
429 | Rate limit exceeded |
500 | Server error |
Wire Protocol
rawquery exposes a Postgres-compatible wire protocol on port 5433. Connect with any Postgres client - psql, DBeaver, Metabase, Looker, Grafana, or your application's Postgres driver.
| Parameter | Value |
|---|---|
| Host | rawquery.dev |
| Port | 5433 |
| User | any value |
| Password | your API key |
| Database | your workspace slug |
| SSL | require |
PGPASSWORD=rq_your_api_key psql -h rawquery.dev -p 5433 -U any -d your-workspacePGPASSWORD=rq_your_api_key psql -h rawquery.dev -p 5433 -U any -d your-workspaceThe wire protocol authenticates against the same API key system. Rate limits apply per plan.
SSL certificate
All connections use TLS. Most clients work with sslmode=require out of the box.
If your tool requires uploading an SSL certificate (Looker, Metabase Cloud, Grafana Cloud), download it from Settings > Wire Protocol in the dashboard, or directly at rawquery.dev/ca.pem.
Table discovery
BI tools that query information_schema.tables for table discovery are supported. The catalog is scoped to your workspace - you only see your own tables.
Next: Execute API - Run SQL queries programmatically with curl, Python, or JavaScript
All Endpoints - Complete reference for workspace, connection, and query endpoints