Get PostHog chart data
Traffic & Analytics
Analytics (PostHog)
Pull your website visitor data from PostHog — users, pageviews, sessions, sources, and devices.
GET
Get PostHog chart data
Get your website analytics from PostHog. These endpoints power the Traffic dashboard’s Analytics tab when PostHog is your connected provider — users, pageviews, sessions, traffic sources, top pages, and device breakdowns.
Call
You need a PostHog integration connected to your team. Connect it from Settings → Integrations → Analytics & Performance. Using Google Analytics 4 instead? See Analytics (Google Analytics 4).
Filters Parameter
Thefilters query parameter accepts URL-encoded JSON with dimensions and their selected values:
GET /integrations/posthog/filter-values for the available dimension values.
Filter Values
GET /integrations/posthog/filter-values
Get the available values for a given filter dimension (used to populate filter dropdowns). Pass dimension as a query parameter — one of channel, referrer, campaign, deviceCategory, browser, os, page.
Traffic Chart
GET /integrations/posthog/chart
Get daily users, pageviews, sessions, and bounce rate for the selected date range — used to power the main trend chart.
Top Pages
GET /integrations/posthog/pages
Get your most-viewed pages with visitor and engagement metrics.
Page Counts
GET /integrations/posthog/analytics
Get page-level visitor counts across your site.
Traffic Sources
GET /integrations/posthog/sources
Get your traffic sources — external referrers and their sessions and users.
Traffic Channels
GET /integrations/posthog/channels
Get your traffic grouped into canonical channels (Direct, Organic Search, Referral, and more).
Traffic by Country
GET /integrations/posthog/countries
See where your visitors are located geographically.
Traffic by Device
GET /integrations/posthog/devices
See the device categories your visitors use.
Traffic by Browser
GET /integrations/posthog/browsers
Break your visitors down by browser.
Traffic by Operating System
GET /integrations/posthog/os
Break your visitors down by operating system.
Campaigns
GET /integrations/posthog/campaigns
Get performance for your UTM-tagged marketing campaigns.
Average Session Duration
GET /integrations/posthog/avg-duration
Get the average session duration with period-over-period comparison.
New vs Returning Visitors
GET /integrations/posthog/user-type
See the split between new and returning visitors.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Team ID
Number of days to look back
Start date (YYYY-MM-DD)
End date (YYYY-MM-DD)
Country filter
Additional PostHog property filters
Response
Default Response

