Endpoint
https://api.solixdb.xyz/v1/query
Authentication
All requests require an API key. Include it in thex-api-key header or as an api-key query parameter.
For details on authentication, see our Authentication guide.
Request Format
Request Fields
- query (required): SQL SELECT query string
- format (optional): Response format -
"json"(default) or"csv"
Automatic LIMIT Injection
If your query doesn’t include a LIMIT clause, a default LIMIT of 1000 is automatically added:You can specify your own LIMIT (up to 10,000). If you specify a LIMIT greater than 10,000, the query will be rejected.
Response Format
JSON Format (default)
CSV Format
Whenformat: "csv" is specified, the response is a CSV string:
Query Restrictions
For security, only read-only queries are allowed:Allowed Operations
SELECTstatementsWITH(CTEs - Common Table Expressions)JOINoperations- Aggregations (
COUNT,SUM,AVG, etc.) GROUP BY,ORDER BY,HAVINGLIMIT,OFFSET- Subqueries
Blocked Operations
The following operations are not allowed:INSERT,UPDATE,DELETEDROP,CREATE,ALTERTRUNCATE,REPLACEGRANT,REVOKEKILL,OPTIMIZE- Multiple statements (semicolons)
Examples
Basic Query
Aggregation Query
This query will automatically get
LIMIT 1000 appended if you don’t specify one.Query with Date Range
Complex Query with CTE
Export to CSV
Error Responses
Invalid Query
Missing LIMIT (if you try to query without one)
Actually, LIMIT is automatically added, so this won’t happen. But if you specify a LIMIT > 10,000:
Query Too Long
Best Practices
Use appropriate LIMIT
Use appropriate LIMIT
Specify a reasonable LIMIT for your use case. The default is 1000, but you can go up to 10,000.
Filter early
Filter early
Use WHERE clauses to filter data early in the query to reduce processing time.
Use indexes
Use indexes
Filter by indexed columns (date, protocol_name, program_id) for better performance.
Avoid SELECT *
Avoid SELECT *
Select only the columns you need to reduce response size and improve performance.
Use aggregations wisely
Use aggregations wisely
Use aggregations (COUNT, SUM, AVG) to reduce result set size when you only need statistics.
Performance Tips
- Use date filters: Always filter by
datewhen possible for partition pruning - Limit result sets: Use LIMIT to avoid large result sets
- Index usage: Filter by
protocol_name,program_id, orsignaturefor indexed lookups - Avoid full table scans: Always include WHERE clauses
