All Connectors
PromptQL Posthog Connector
PromptQL Posthog Connector
PromptQL Posthog Connector
Connects to PostHog analytics and support executing HogQL queries, discovering dashboards, and retrieving insight definitions.
About
Released
February 11, 2026
Last Updated
February 11, 2026
GitHub Repo

PostHog Connector for Hasura DDN

A Hasura NDC (Native Data Connector) that enables querying PostHog analytics via HogQL queries, discovering dashboards, and retrieving insight definitions.

Features

  • Execute HogQL queries (ClickHouse SQL dialect) against your PostHog data
  • List all dashboards with metadata (timestamps, pinned status, insight summaries)
  • Retrieve detailed insight definitions including query/filter configurations
  • Ideal for AI agents to discover analytics topics and problems in an account

Environment Variables

VariableRequiredDescriptionDefault
POSTHOG_API_KEYYesPostHog API key for authentication. Get from PostHog Settings > Project > Personal API Keys-
POSTHOG_PROJECT_IDYesPostHog project ID. Found in PostHog URL: app.posthog.com/project/{PROJECT_ID}-
POSTHOG_HOSTNoPostHog API host URLus.posthog.com

HogQL Query Examples

Count events by type

SELECT event, count() as count
FROM events
WHERE timestamp > now() - INTERVAL 7 DAY
GROUP BY event
ORDER BY count DESC
LIMIT 10

Get unique users per day

SELECT
  toDate(timestamp) as date,
  uniq(distinct_id) as unique_users
FROM events
WHERE timestamp > now() - INTERVAL 30 DAY
GROUP BY date
ORDER BY date

Page view funnel

SELECT
  event,
  count() as count
FROM events
WHERE event IN ('$pageview', 'sign_up', 'purchase')
  AND timestamp > now() - INTERVAL 7 DAY
GROUP BY event

User properties

SELECT
  properties.$browser as browser,
  count() as count
FROM events
WHERE timestamp > now() - INTERVAL 7 DAY
GROUP BY browser
ORDER BY count DESC

PostHog Host URLs

RegionHost
US Cloudus.posthog.com
EU Cloudeu.posthog.com
Self-hostedYour PostHog instance URL

Ship a rock-solid API on your data – in minutes!