Query APIs
Expose any ClickHouse table as an API.
Out-of-the-box Query APIs for the most common analytics use cases and data visualizations.
SQL API
Execute SQL queries from your application.
Counter
Get a single aggregated value for a time range.
Data Grid
Get a table of records from a Data Pool.
Leaderboard
Get aggregated values grouped by common dimensions.
Metric Report
Get multiple aggregated values grouped by common dimensions.
Time Series
Get ready-to-chart time series data.
Top Values
Get the most frequent non-null values in a column.
You can test your GraphQL API requests without writing a single line of code in our API Playground.
Common features
All of our APIs offer the following features:
Pre-defined or inline metric aggregations
Pre-defined or inline metric aggregations
Make API requests using pre-defined or inline Metric definitions.
Query using an in-line metric definition:
Query using a pre-defined metric definition by ID:
Query using a pre-defined metric definition by name:
Built-in relative time ranges
Built-in relative time ranges
Built-in relative time ranges make it easy to implement common scenarios:
- Current periods:
THIS_HOUR
,TODAY
,THIS_WEEK
,THIS_MONTH
,THIS_QUARTER
,THIS_YEAR
- Previous periods:
PREVIOUS_HOUR
,YESTERDAY
,PREVIOUS_WEEK
,PREVIOUS_MONTH
,PREVIOUS_QUARTER
,PREVIOUS_YEAR
- Next periods:
NEXT_HOUR
,TOMORROW
,NEXT_WEEK
,NEXT_MONTH
,NEXT_QUARTER
,NEXT_YEAR
- Last N periods:
LAST_N_MINUTES
,LAST_N_HOURS
,LAST_N_DAYS
,LAST_N_WEEKS
,LAST_N_MONTHS
,LAST_N_QUARTERS
,LAST_N_YEARS
Absolute time ranges
Absolute time ranges
Absolute time ranges allow for precise date and time selection.
Filtering
Filtering
Apply filters using SQL syntax.
Timezone support
Timezone support
Calculates the relative time ranges for the given time zone, allowing for accurate representation of data across different geographical locations.
FINAL modifier
FINAL modifier
Automatically adds the FINAL modifier to queries on ReplacingMergeTree tables, ensuring that the latest data is always used.
Secured by Access Policies
Secured by Access Policies
Access Policies are enforced for all Query APIs.
For more details, see our Access Policies documentation.
Multi-tenant JWT tokens
Multi-tenant JWT tokens
Use JWT tokens to secure multi-tenant applications with any Data API.
For more details, see our Multi-tenant JWT tokens documentation.