HTTP API

Query with SQL via the HTTP API

Data may be queried by posting SQL to the /v1/sql API and /v1/firesql API for Firecached data. For documentation on the Spice Firecache see .

See Tables for a list of tables to query or browse the example queries listed in the menu.

Requirements and limitations

  • An API key is required for all SQL queries.

  • Results are limited to 500 rows. Use the Apache Arrow Flight API to fetch up to 1M rows in a single query or the Async HTTP API to fetch results with paging.

  • Requests are limited to 90 seconds.

SQL Query

post

Execute a SQL query and return the results.\n\nThis endpoint allows users to execute SQL queries directly from an HTTP request. The SQL query is sent as plain text in the request body.

Authorizations
Header parameters
AcceptstringRequired

The format of the response, one of 'application/json' (default), 'application/vnd.spiceai.sql.v1+json', 'text/csv' or 'text/plain'.

Body
objectOptional
Responses
200

SpiceAI SQL v1+json result

Responseone of
objectOptional
or
stringOptional
or
stringOptional
or
objectOptional
post
POST /v1/sql HTTP/1.1
Host: data.spiceai.io
X-API-KEY: YOUR_API_KEY
Accept: text
Content-Type: application/json
Content-Length: 2

{}
{}

Last updated

Was this helpful?