Open-Source Wikis

/

ClickHouse

/

API

clickhouse/clickhouse

API

ClickHouse exposes data through several wire protocols. Pick whichever fits your client best — they are layered on top of the same engine, with the same SQL surface.

Page Endpoint Best for
HTTP interface TCP 8123 / 8443 Curl, custom clients, embedded UIs, wide compatibility.
Native TCP TCP 9000 / 9440 Lowest latency and CPU. Used by clickhouse-client, JDBC, ODBC, and language drivers.
MySQL wire TCP 9004 Reuse mysql and BI tools that speak MySQL.
Postgres wire TCP 9005 Reuse psql, libpq, and tools that speak Postgres.
gRPC TCP 9100 Streaming protobuf API for service-to-service integration.
Arrow Flight TCP 9006 Apache Arrow Flight RPC; ideal for Polars/DuckDB/Spark integrations.

What is shared

Every protocol funnels into the same Context, picks up the user's profile and permissions, and runs the query through the same parser → analyzer → planner → processor pipeline. So:

  • The SQL dialect is the same across all of them.
  • Settings (SET ... / per-query overrides) work the same way.
  • All protocols carry progress, logs, and profile events alongside the result, where the protocol allows.
  • All protocols can return any format (HTTP picks per request; native picks at handshake).

Authentication

Protocol Auth
HTTP Authorization, X-ClickHouse-User/Key, basic auth, mTLS
Native TCP Username + password, JWT, Kerberos, SSH key
MySQL mysql_native_password, caching_sha2_password
Postgres md5, scram-sha-256, cleartext
gRPC Token via metadata, mTLS
Arrow Flight Bearer token, mTLS

See Access control for the underlying auth machinery.

Compression

  • HTTP: request body and response body can be gzip / zstd / br / deflate. Native ClickHouse compression for the streamed response is available via compress=1.
  • Native TCP: network_compression_methodLZ4 (default) or ZSTD.
  • gRPC / Arrow Flight: rely on transport compression.

See Compression.

Choosing a protocol

  • Curl, fetch, language libraries you already have → HTTP.
  • Maximum throughput, official drivers → Native TCP.
  • Existing MySQL or Postgres tooling → the matching wire.
  • Service mesh, streaming results, contracts you can version → gRPC.
  • Arrow ecosystem → Arrow Flight.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

API – ClickHouse wiki | Factory