posthog

Query events and analytics via HogQL using the PostHog REST API.

94|2|Updated May 11, 2026
One-click install
npx skills add https://github.com/byaan-ai/byaan --skill posthog-byaan-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: posthog
Source: https://github.com/byaan-ai/byaan/tree/main/server/skills/posthog
Command: npx skills add https://github.com/byaan-ai/byaan --skill posthog-byaan-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PostHog provides a unified API to query events, run HogQL analytics, and access product data such as persons, insights, dashboards, and feature flags, enabling teams to derive actionable analytics without leaving their data.

Core Features & Use Cases

  • HogQL-based analytics on events and properties
  • Access events, persons, insights, dashboards, and feature flags via REST endpoints
  • Authenticate with Personal API Keys and manage project-scoped data securely
  • Use cases include event counting, cohort analysis, funnel tracking, and dashboard generation

Quick Start

Query the most recent events using HogQL to return the top events in your project.

Frequently Asked Questions about posthog

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query PostHog events and analytics using HogQL?

To query PostHog events and analytics, you submit a HogQL query body with the kind set to HogQLQuery via the PostHog REST API. This allows you to count events, track funnels, and generate dashboard insights directly from your project data.

What do I need to access PostHog product data via the REST API?

Accessing PostHog product data via the REST API requires a valid Personal API key configured in credentials and a valid project_id in your endpoint. This authenticates your requests and scopes data access securely to your specific project.

Can I retrieve persons, dashboards, and feature flags from PostHog through an API?

Yes, you can retrieve persons, dashboards, and feature flags from PostHog through its REST API endpoints. The API provides unified access to query events, run HogQL analytics, and manage product data across supported regions.

What is the best way to run cohort analysis or funnel tracking on PostHog events?

The best way to run cohort analysis or funnel tracking on PostHog events is by executing HogQL-based analytics queries through the REST API. This method enables you to derive actionable analytics and query event properties without leaving your data environment.

Does querying PostHog analytics across different regions require specific authentication?

Querying PostHog analytics across regions requires a valid Personal API key for authentication. You must include this key in your credentials and ensure a valid project_id is specified in the endpoint to successfully execute HogQL queries.

Why is my HogQL query not returning insights from the PostHog API?

Your HogQL query may not return insights if the query body lacks the required kind parameter set to HogQLQuery. Additionally, missing or invalid API keys in credentials or an incorrect project_id in the endpoint will prevent successful authentication and data retrieval.