# SQL Query API

The SQL Query API provides powerful capabilities for querying data managed by the Spice.ai Cloud Data Warehouse and connected external data sources using federated SQL queries. Results can be fetched through either the high-performance Apache Arrow Flight API or a standard HTTP API.

### Production Query Endpoints

#### Apache Arrow Flight API

For production use, leverage the high-performance Apache Arrow Flight API, which is optimized for large-scale data workloads. The Spice SDKs default to querying via Arrow Flight.

• Endpoint: `grpc+tls://flight.spiceai.io`

• For additional details, refer to the [Apache Arrow Flight API documentation](/api/runtime-apis/sql-query/apache-arrow-flight-api.md).

#### HTTP API

The SQL Query API is also accessible via HTTP, offering standard integration for web applications.

• Core Endpoint: `https://data.spiceai.io/v1/sql`

• For more details, consult the [HTTP SQL API documentation](/api/runtime-apis/sql-query/http-api.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.spice.ai/api/runtime-apis/sql-query.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
