provider surveys GET /api/projects/{project_id}/surveys/{id}/stats/
@utdk/posthog /api/projects/{project_id}/surveys/{id}/stats/
surveys_stats_retrieve
Get survey response statistics for a specific survey. Args: date_from: Optional ISO timestamp for start date (e.g. 2024-01-01T00:00:00Z) date_to: Optional ISO timestamp for end date (e.g. 2024-01-31T23:59:59Z) exclude_archived: Optional boolean to exclude archived responses (default: false, includes archived) include_per_question_stats: Optional boolean to include per-question response counts and distributions Returns: Survey statistics including event counts, unique respondents, and conversion rates
date_from query
Optional ISO timestamp for start date (e.g. 2024-01-01T00:00:00Z)
string
date_to query
Optional ISO timestamp for end date (e.g. 2024-01-31T23:59:59Z)
string
id path required
A UUID string identifying this survey.
string
include_per_question_stats query
When true, also return per-question response counts and answer distributions. Adds one extra HogQL query per question, so leave off unless you need the breakdown.
boolean
project_id path required
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
string

Try it

Authentication
Configure credentials for PostHog API
surveysStatsRetrieve
GET/api/projects/{project_id}/surveys/{id}/stats/
Get survey response statistics for a specific survey. Args: date_from: Optional ISO timestamp for start date (e.g. 2024-01-01T00:00:00Z) date_to: Optional ISO timestamp for end date (e.g. 2024-01-31T23:59:59Z) exclude_archived: Optional boolean to exclude archived responses (default: false, includes archived) include_per_question_stats: Optional boolean to include per-question response counts and distributions Returns: Survey statistics including event counts, unique respondents, and conversion rates

Parameters

required

A UUID string identifying this survey.

required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Optional ISO timestamp for start date (e.g. 2024-01-01T00:00:00Z)

Optional ISO timestamp for end date (e.g. 2024-01-31T23:59:59Z)

When true, also return per-question response counts and answer distributions. Adds one extra HogQL query per question, so leave off unless you need the breakdown.

Configure credentials above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import posthog from '@utdk/posthog';

await posthog.surveysStatsRetrieve()