Skip to main content
The REST API provides endpoints for SQL query execution and system health checks. For method-based transaction queries, use the JSON-RPC API.

Base URL

https://api.solixdb.xyz/v1

Authentication

All API endpoints require an API key. Include it in the x-api-key header or as an api-key query parameter.
For details on authentication, see our Authentication guide.

Endpoints

SQL Query

Execute read-only SQL SELECT queries against ClickHouse. Endpoint: POST /query Request Body:
{
  "query": "SELECT * FROM transactions WHERE protocol_name = 'jupiter_v6' LIMIT 10",
  "format": "json"
}
Parameters:
ParameterTypeRequiredDescription
querystringYesSQL SELECT query (read-only)
formatstringNoResponse format: "json" (default) or "csv"
Response (JSON):
{
  "data": [
    {
      "signature": "5VERv8NMxzbPDohNpJhHopN2C9R4G5GaPevYf5hLJ8Z7",
      "protocol_name": "jupiter_v6",
      "fee": "5000"
    }
  ],
  "count": 10,
  "query": "SELECT signature, protocol_name, fee FROM transactions WHERE protocol_name = 'jupiter_v6' LIMIT 10"
}
Response (CSV):
signature,protocol_name,fee
5VERv8NMxzbPDohNpJhHopN2C9R4G5GaPevYf5hLJ8Z7,jupiter_v6,5000
Automatic LIMIT: If your query doesn’t include a LIMIT clause, a default LIMIT of 1000 is automatically added. Maximum allowed LIMIT is 10,000.
Example:
curl -X POST "https://api.solixdb.xyz/v1/query" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "query": "SELECT signature, protocol_name, fee FROM transactions WHERE protocol_name = '\''jupiter_v6'\'' LIMIT 10",
    "format": "json"
  }'

Health Check

Check API and service health status. Endpoint: GET /health Note: This endpoint does not require authentication. Response:
{
  "status": "healthy",
  "timestamp": "2025-01-20T10:00:00.000Z",
  "version": "1.0.0",
  "uptime": 12345,
  "environment": "production",
  "services": {
    "clickhouse": "up",
    "redis": "up"
  }
}
Example:
curl "https://api.solixdb.xyz/health"

Query Restrictions

For security, only read-only queries are allowed:

Allowed Operations

  • SELECT statements
  • WITH (CTEs - Common Table Expressions)
  • JOIN operations
  • Aggregations (COUNT, SUM, AVG, etc.)
  • GROUP BY, ORDER BY, HAVING
  • LIMIT, OFFSET
  • Subqueries

Blocked Operations

The following operations are not allowed:
  • INSERT, UPDATE, DELETE
  • DROP, CREATE, ALTER
  • TRUNCATE, REPLACE
  • GRANT, REVOKE
  • KILL, OPTIMIZE
  • Multiple statements (semicolons)

Error Responses

Invalid Query

{
  "error": "Invalid query",
  "message": "Only SELECT queries are allowed"
}
Status Code: 400 Bad Request

Missing API Key

{
  "error": "Unauthorized",
  "message": "API key is required. Provide it via x-api-key header or api-key query parameter."
}
Status Code: 401 Unauthorized

Rate Limit Exceeded

{
  "error": "Too Many Requests",
  "message": "Rate limit exceeded for plan 'free'. Limit: 100 requests/minute, Used: 100. Retry after 60 seconds.",
  "plan": "free",
  "limit": 100,
  "used": 100,
  "retryAfter": 60
}
Status Code: 429 Too Many Requests

Best Practices

Specify a reasonable LIMIT for your use case. The default is 1000, but you can go up to 10,000.
Use WHERE clauses to filter data early in the query to reduce processing time.
Filter by indexed columns (date, protocol_name, program_id) for better performance.
Select only the columns you need to reduce response size and improve performance.

Next Steps