Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PostHog Dashboard CLI

A command-line tool for querying PostHog data and building dashboards.

Setup

  1. Clone this repository
  2. Install dependencies:
    pip install -r requirements.txt
    
  3. Create a .env file with your PostHog credentials (use .env.example as a template)

Usage

List all event names

python posthog_client.py --api-key YOUR_API_KEY --project-id YOUR_PROJECT_ID events

List all event property names

python posthog_client.py --api-key YOUR_API_KEY --project-id YOUR_PROJECT_ID properties

Get recent events (optionally filtered by event name)

python posthog_client.py --api-key YOUR_API_KEY --project-id YOUR_PROJECT_ID get-events --event-name $pageview --limit 10

Get daily active users for the last 30 days

python posthog_client.py --api-key YOUR_API_KEY --project-id YOUR_PROJECT_ID user-counts --period day --date-from -30d

Get event counts over time

python posthog_client.py --api-key YOUR_API_KEY --project-id YOUR_PROJECT_ID event-counts --event-name $pageview --period day --date-from -30d

Environment Variables

You can set the following environment variables in your .env file:

  • POSTHOG_API_KEY: Your PostHog API key
  • POSTHOG_PROJECT_ID: Your PostHog project ID
  • POSTHOG_BASE_URL: Your PostHog instance URL (defaults to https://app.posthog.com)

About

a client that helps me create posthog dashboards using api calls

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages