PostHog API

API Freemium Caution Analytics
Pricing

Free

Usage-based after the free allowance. Identified events $0.000198 each, anonymous $0.00005 each, after the first 1M a month.

Free tier

1M events/mo free; API for all users

Auth

API key

Personal API key sent as a bearer token. Project secret keys (beta) and OAuth are also supported.

Data it gives

Events and event properties
Persons and cohorts
Insights, funnels and trends
Session recordings
Feature flags

Pricing checked on 23 Oct 2026 · Pricing page · Docs

Description

The PostHog API lets you read analytics data and manage the PostHog project by code. The query endpoint runs HogQL-style queries over events, and other endpoints cover insights, persons, session recordings and feature flags.

It fits agents and workflows that need product usage data: funnels, cohort exports, event lookups, and flag changes. Public endpoints (capture, flags) send data in. Private endpoints read and manage data and need a key.

Use it if you track product or marketing events in PostHog. For big exports the docs point to batch exports instead of the query endpoint.

Key endpoints

  • POST /api/projects/{project_id}/query/: run a query over your data
  • GET /api/projects/{project_id}/events/: list events
  • GET /api/projects/{project_id}/persons/: list persons
  • GET /api/projects/{project_id}/insights/: list saved insights

Example request

curl "https://us.posthog.com/api/projects/YOUR_PROJECT_ID/events/" \
  -H "Authorization: Bearer YOUR_API_KEY"

Tech details

API style
REST
Base URL
https://us.posthog.com
Rate limits
Analytics endpoints 240/min and 1200/hour. Query endpoint 2400/hour. Other CRUD endpoints 480/min and 4800/hour. Per personal API key.
Official SDKs
See docs

Use Cases

Events and event properties

Persons and cohorts

Insights, funnels and trends

Session recordings

Feature flags

Editor’s note What our review found

Editorial research, reviewed 23 Oct 2026. We read PostHog's API docs and pricing page. We did not run live calls. This listing is not an endorsement.

Cost: the API docs say the API "is available for all users and instances". The pricing page shows a free allowance that resets every month, with no card needed: 1M analytics events, 5K session recordings and 1M feature flag requests, among others. After that you pay as you go: identified events cost $0.000198 each and anonymous events $0.00005 each after the first 1M. Whether the API has its own limits on the free tier is covered by the rate limits below.

Credentials and data: private endpoints use a personal API key tied to your account, a project secret key (beta) or OAuth. Store keys in a secret manager or environment variable, never in code or a plain-text file. A personal key has the access of your account. Queries return event and person data, which can include personal data of your users, so consider GDPR and consent before sending it to other tools or AI models.

Good to know: US and EU Cloud use different hosts, and you must use the one for your region. Rate limits apply per personal API key.

Related Skills, MCPs, CLIs & APIs

Frequently Asked Questions

Does PostHog API have a free tier?
Free tier: 1M events/mo free; API for all users.
How do I authenticate with PostHog API?
PostHog API uses an API key. Personal API key sent as a bearer token. Project secret keys (beta) and OAuth are also supported.
What data does PostHog API give?
PostHog API provides: Events and event properties, Persons and cohorts, Insights, funnels and trends, Session recordings, Feature flags.
How much does PostHog API cost?
Pricing model: Freemium. Usage-based after the free allowance. Identified events $0.000198 each, anonymous $0.00005 each, after the first 1M a month.