API ReferenceData & Analytics
Enterprise read-only SQL over the catalog.
const url = 'https://data.predictefy.com/v1/sql';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"query":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://data.predictefy.com/v1/sql \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "query": "example" }'Requires the sql scope. Returns 404 when this feature is not available. Executes one read-only PostgreSQL statement (SELECT, WITH ... SELECT, or plain EXPLAIN). Rejects writes, schema changes and session-control statements before execution. Accepted requests run in a read-only transaction with a statement timeout. Results are capped at the service row limit and include a truncation flag.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
A single read-only SQL statement. Semicolon-separated statements are rejected.
Examplegenerated
{ "query": "example"}Responses
Section titled “Responses”Rows returned by the read-only SQL statement.
object
object
object
object
Examplegenerated
{ "success": true, "data": { "rows": [ {} ], "fields": [ { "name": "example" } ], "rowCount": 1, "truncated": true }}Headers
Section titled “Headers”Net credits charged for this metered response after any error refund.
Post-charge account balance. Present only when the existing debit/refund operation made it available; the service never adds an extra balance lookup solely for this header.
VALIDATION_ERROR / SQL_QUERY_FAILED
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}Headers
Section titled “Headers”Net credits charged for this metered response after any error refund.
Post-charge account balance. Present only when the existing debit/refund operation made it available; the service never adds an extra balance lookup solely for this header.
UNAUTHORIZED: a valid API key is required.
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}INSUFFICIENT_CREDITS: endpoint-weighted credits
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}Headers
Section titled “Headers”Net credits charged for this metered response after any error refund.
Post-charge account balance. Present only when the existing debit/refund operation made it available; the service never adds an extra balance lookup solely for this header.
SCOPE_MISSING: API key lacks the required sql scope (RBAC v1)
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}ROUTE_NOT_FOUND when this feature is not available.
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}RATE_LIMITED: per-key rps limit
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}Unexpected service error after pricing. Retryable.
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}Headers
Section titled “Headers”Net credits charged for this metered response after any error refund.
Post-charge account balance. Present only when the existing debit/refund operation made it available; the service never adds an extra balance lookup solely for this header.
SQL_TIMEOUT / platform unavailable
object
object
Always present on errors; quote this id when reporting a failed request.
Optional machine-readable refusal details. It names a reason code and never echoes request values.
Present only when a venue error is attributed to a specific exchange.
Optional, report-only upstream book error class; never changes retry behavior.
Example
{ "success": false, "error": { "code": "VALIDATION_ERROR" }}Headers
Section titled “Headers”Net credits charged for this metered response after any error refund.
Post-charge account balance. Present only when the existing debit/refund operation made it available; the service never adds an extra balance lookup solely for this header.