Skip to main content
This endpoint is effectively deprecated. For querying and analyzing events, use the Query endpoint instead. For bulk event exports, use PostHog’s CDP or Batch Exports features.
The List Events endpoint allows you to retrieve a paginated list of events with basic filtering capabilities.

Endpoint

Authentication

Use a Personal API Key in the Authorization header:

Path Parameters

string
required
The ID of your PostHog project.

Query Parameters

string
Filter events by event name. Example: user_sign_up or $pageview.
string
Filter events by a specific distinct ID (user identifier).
integer
Filter events by PostHog person ID.
datetime
Return only events with a timestamp before this time. Defaults to now() + 5 seconds.Format: ISO 8601 datetime (e.g., 2024-03-15T14:30:00Z)
datetime
Return only events with a timestamp after this time. Defaults to now() - 24 hours.Format: ISO 8601 datetime (e.g., 2024-03-15T14:30:00Z)
integer
default:"100"
Maximum number of results to return. Maximum value: 10,000.
integer
deprecated
Number of results to skip. Deprecated: Use timestamp-based pagination instead.
Offset-based pagination is deprecated and will fail for values larger than 50,000. Use before/after parameters for timestamp-based pagination.
json
Filter events by property values. Provide as URL-encoded JSON.Example: properties=[{"key":"$browser","value":"Chrome"}]
json
Order results by fields. Defaults to ["-timestamp"] (newest first).Example: orderBy=["timestamp"] for oldest first.
json
(Experimental) Specify which fields to return using HogQL expressions.
json
(Experimental) Additional HogQL filter expressions.

Response

array
Array of event objects.
string
Unique event UUID.
string
Event name.
string
The distinct ID associated with this event.
object
Event properties as key-value pairs.
datetime
When the event occurred (ISO 8601 format).
object
Person information (if available and requested).
integer
Person ID.
string
Person’s display name.
array
All distinct IDs associated with this person.
object
Person properties.
array
DOM elements associated with the event (for autocapture events).
string
URL for the next page of results. null if no more results.

Examples

Pagination

Use the before and after parameters with the next URL from the response:

How It Works

  1. Initial request returns up to limit events
  2. If more events exist, next contains a URL with before or after parameter
  3. Request the next URL to get the next page
  4. Repeat until next is null
The next URL automatically includes the appropriate before or after timestamp based on your sort order.

Retrieve Single Event

To retrieve a specific event by its UUID:

Rate Limiting

The Events List endpoint is subject to rate limiting:
  • Burst rate: 240 requests per minute
  • Sustained rate: 480 requests per hour
If you exceed these limits, you’ll receive a 429 Too Many Requests response.

Performance Considerations

Time Windows

PostHog automatically optimizes queries using progressive time windows. The API:
  1. Starts with a small time window (1 minute)
  2. Progressively expands if insufficient results are found
  3. Caches successful window sizes for future requests
This optimization happens automatically and improves performance for recent event queries.

Best Practices

  1. Always specify time range: Use after and before to limit the data scanned
  2. Use appropriate limits: Don’t request more data than needed
  3. Filter early: Apply event and distinct_id filters to reduce result sets
  4. Use timestamp pagination: Avoid offset-based pagination for large datasets
  5. Consider the Query endpoint: For complex analysis, use /api/projects/:id/query instead

CSV Export

Request events in CSV format by setting the Accept header:
CSV exports default to 3,500 events maximum.

Migration to Query Endpoint

If you’re using the List Events endpoint, consider migrating to the Query endpoint for better performance and capabilities:
The Query endpoint offers:
  • Better performance for complex queries
  • More powerful filtering with HogQL
  • Aggregation capabilities
  • Better caching
  • Lower rate limits