ClickHouse REST API
High-performance columnar database for real-time analytics
ClickHouse is an open-source column-oriented database management system designed for online analytical processing (OLAP). It enables real-time analytics on petabytes of data with sub-second query response times. Developers use ClickHouse for building analytics dashboards, event logging systems, time-series analysis, and business intelligence applications that require fast aggregations and complex analytical queries.
https://your-cluster.clickhouse.cloud:8443
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | / | Execute a SELECT query and retrieve results in various formats (JSON, CSV, TabSeparated) |
| POST | / | Execute INSERT, CREATE, DROP, ALTER and other SQL statements via HTTP POST |
| GET | /?query={sql} | Execute a query using URL parameter with automatic format detection |
| POST | /?query=INSERT INTO table FORMAT JSONEachRow | Insert data in JSON format (one JSON object per line) |
| GET | /?query=SELECT * FROM system.tables | List all tables in the database using system tables |
| GET | /?query=SELECT * FROM system.databases | List all databases in the ClickHouse instance |
| GET | /?query=SHOW CREATE TABLE {table} | Get the CREATE TABLE statement for a specific table |
| GET | /?query=SELECT * FROM system.columns WHERE table='{table}' | Get column information and metadata for a specific table |
| GET | /?query=SELECT * FROM system.query_log | Retrieve query execution history and performance metrics |
| POST | /?query=CREATE TABLE {table} | Create a new table with specified schema and engine |
| POST | /?query=ALTER TABLE {table} | Modify table structure, add/drop columns, or change settings |
| GET | /?query=SELECT * FROM system.parts | Get information about data parts in MergeTree tables for optimization |
| GET | /?query=SELECT * FROM system.metrics | Retrieve current system metrics and performance indicators |
| POST | /?query=OPTIMIZE TABLE {table} | Trigger manual optimization and merging of table data parts |
| GET | /ping | Health check endpoint to verify server availability |
Sponsor this page
AvailableReach developers actively building with ClickHouse. See live pageview data and self-serve checkout — your slot goes live in minutes.
View inventory & pricing →Code Examples
# Query data from ClickHouse
curl -u default:your_password \
'https://your-cluster.clickhouse.cloud:8443/?query=SELECT%20count()%20FROM%20events%20WHERE%20date%20=%20today()%20FORMAT%20JSON'
# Insert data into ClickHouse
curl -u default:your_password \
-X POST 'https://your-cluster.clickhouse.cloud:8443/?query=INSERT%20INTO%20events%20FORMAT%20JSONEachRow' \
-d '{"user_id":123,"event_type":"click","timestamp":"2024-01-15 10:30:00"}'
# Create a table
curl -u default:your_password \
-X POST 'https://your-cluster.clickhouse.cloud:8443/' \
-d 'CREATE TABLE analytics.events (user_id UInt64, event_type String, timestamp DateTime) ENGINE = MergeTree() ORDER BY timestamp'
Use ClickHouse from Claude / Cursor / ChatGPT
Get a hosted MCP endpoint for ClickHouse. Paste your ClickHouse API key, copy back one URL, drop it into Claude Desktop, Cursor, or any AI client that supports remote MCP. Your AI calls ClickHouse directly with your credentials — no local install, works on mobile.
clickhouse_query
Execute analytical SQL queries on ClickHouse databases and return aggregated results in JSON format
clickhouse_insert
Insert event data, logs, or metrics into ClickHouse tables with automatic batching and format conversion
clickhouse_schema_inspector
Inspect database schemas, list tables, columns, and data types to understand available data structures
clickhouse_performance_analyzer
Analyze query performance, execution times, and resource usage from system tables for optimization recommendations
clickhouse_table_manager
Create, modify, and optimize ClickHouse tables with appropriate engines and partitioning strategies
Connect in 60 seconds
Paste your ClickHouse key → get an MCP URL → paste into Claude/Cursor. Hosted by IOX, encrypted at rest.
Connect ClickHouse to your AI →