Query API endpoints
Building interactive data-driven applications requires not only a fast database, well-structured data, and optimized queries. Your front-end and microservices also need an easy way to consume the data returned by those queries, preferably via well-structured APIs.
The Query API Endpoints feature allows you to create an API endpoint directly from any saved SQL query in the ClickHouse Cloud console. You'll be able to access API endpoints via HTTP to execute your saved queries without needing to connect to your ClickHouse Cloud service via a native driver.
IP Access Control
Query API endpoints respect API key-level IP whitelisting. Similar to the SQL Console, Query API endpoints proxy requests from within ClickHouse's infrastructure, so service-level IP whitelist settings do not apply.
To restrict which clients can call your Query API endpoints:
Open API key settings
- Go to ClickHouse Cloud Console → Organization → API Keys
- Click Edit next to the API key used for Query API endpoints
Add allowed IP addresses
- In the Allow access to this API Key section, select Specific locations
- Enter IP addresses or CIDR ranges (e.g.,
203.0.113.1or203.0.113.0/24) - Add multiple entries as needed
Creating Query API endpoints requires an Admin Console Role and an API key with appropriate permissions.
See the Query API endpoints guide for instructions on how to set up query API endpoints in a few easy steps