---
title: "Adding Analytics to an Application in under 10 minutes with ClickHouse Cloud Query Endpoints"
description: "ClickHouse Cloud's beta API endpoints turn a saved parameterized SQL query into a secure HTTP POST endpoint, moving SQL out of application code so queries can change without redeploying."
url: "https://swe.quest/articles/adding-analytics-to-an-application-in-under-10-minutes-with-clickhouse-cloud-8026d8ff6e788ea8"
canonical: "https://clickhouse.com/blog/adding-analytics-to-an-application-with-clickhouse-query-endpoints"
source: "ClickHouse"
published: "2024-09-24"
difficulty: "medium"
kind: "How-to"
reading_minutes: 9
tags: ["analytics","api-design","sql","react"]
---

# Adding Analytics to an Application in under 10 minutes with ClickHouse Cloud Query Endpoints

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2024-09-24, 9 min read, How-to. Original: [https://clickhouse.com/blog/adding-analytics-to-an-application-with-clickhouse-query-endpoints](https://clickhouse.com/blog/adding-analytics-to-an-application-with-clickhouse-query-endpoints)

## Summary

ClickHouse Cloud's beta API endpoints turn a saved parameterized SQL query into a secure HTTP POST endpoint, moving SQL out of application code so queries can change without redeploying. The walkthrough adds GitHub stars, issues, forks and PR counts to the ClickPy PyPI dashboard. A query resolves each package's GitHub repo ID from PyPI metadata and aggregates the GitHub events table with uniqExactIf. The endpoint is bound to a read-only role with IP-keyed quotas and optional CORS, then called from a Next.js/React component via a generic fetch helper, returning any of ClickHouse's output formats such as JSONEachRow.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [API design](https://swe.quest/tags/api-design.md) (Backend & APIs)
- [SQL](https://swe.quest/tags/sql.md) (Languages)
- [React](https://swe.quest/tags/react.md) (Web & mobile)

## Prerequisites

- SQL basics ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- ClickHouse ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))
- React/Next.js ([easy posts on React](https://swe.quest/tags/react.md?difficulty=easy))

## Keywords

ClickHouse Cloud, ClickPy, Query Endpoints, PyPI, GitHub events, Next.js

## Related posts

- [Announcing the new ClickHouse SQL Playground](https://swe.quest/articles/announcing-the-new-clickhouse-sql-playground-3d79733825c39f99.md): ClickHouse · 2024-10-31 · Medium · 7 min read · Analytics & OLAP, Frontend, API design
  sql.clickhouse.com is a new public SQL playground offering over 35 datasets (60 TB) and 220 example queries, with syntax highlighting, autocomplete, query parameters, basic charting via Apache ECharts and shareable links.
- [What's new in ClickStack - Aug ’26](https://swe.quest/articles/what-s-new-in-clickstack-aug-26-6426e76d49852a0f.md): ClickHouse · 2026-09-16 · Medium · 16 min read · Observability, Analytics & OLAP, LLMs
  ClickStack v2.34–v2.38 centers on dashboards: dashboard variables are now GA, letting a filter's selection be substituted into raw SQL, builder fields, Lucene and PromQL, with macros like $\_\_filter and $\_\_conditionalAll to handle empty selections and chained dropdowns.
- [ClickHouse Plugin for Grafana - 2.0 Release](https://swe.quest/articles/clickhouse-plugin-for-grafana-2-0-release-6cc77a953b0e269e.md): ClickHouse · 2022-09-02 · Medium · 9 min read · Analytics & OLAP, Observability, SQL
  Version 2.0 of the ClickHouse Grafana plugin drops its client-side SQL AST parser and implements ad-hoc filters with ClickHouse's new \`additional\_table\_filters\` setting (22.7+), so the server injects each filter into the correct clauses, including subqueries.
- [ClickHouse Newsletter July 2023: Seeing Clearly](https://swe.quest/articles/clickhouse-newsletter-july-2023-seeing-clearly-a153c241f5923252.md): ClickHouse · 2023-07-24 · Medium · 10 min read · Analytics & OLAP, SQL, Databases
  ClickHouse v23.6 adds 10 features, 12 performance optimisations and 31 bug fixes.
- [What's new in ClickStack - September and October '26](https://swe.quest/articles/what-s-new-in-clickstack-september-and-october-26-a21e3a80f34a3dc9.md): ClickHouse · 2026-11-03 · Medium · 18 min read · Observability, Analytics & OLAP
  ClickStack v2.39 through v2.42 add ad hoc dashboard filters with click-to-filter from tiles, single-select and required filters, saved relative time ranges, and dashboard variables in markdown tiles.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
