provider insights GET
/api/environments/{environment_id}/insights/trending/ @utdk/posthog
/api/environments/{environment_id}/insights/trending/ environments_insights_trending_retrieve
Returns insights ranked by view count over the last N days (default 7), highest first. Each result includes the same metadata as the standard insights list, plus a `view_count` and up to 3 recent `viewers`. Useful for surfacing the most-used insights in a project.
- days query
- Time window in days to compute view counts over. Defaults to 7. Larger windows surface consistently popular insights; smaller windows surface what's hot right now.
- integer
- environment_id path required
- Deprecated. Use /api/projects/{project_id}/ instead.
- string
- format query
- enum: csv, json
- limit query
- Maximum number of insights to return. Defaults to 10. Capped at 100.
- integer
- offset query
- The initial index from which to return the results.
- integer
Try it
Authentication
Configure credentials for PostHog API
Code snippet
Updates live as you fill in the form above.
TypeScript
import posthog from '@utdk/posthog';
await posthog.environmentsInsightsTrendingRetrieve()