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.
Endpoint
Authentication
Use a Personal API Key in theAuthorization 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
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
Timestamp-based Pagination (Recommended)
Use thebefore and after parameters with the next URL from the response:
How It Works
- Initial request returns up to
limitevents - If more events exist,
nextcontains a URL withbeforeorafterparameter - Request the
nextURL to get the next page - Repeat until
nextisnull
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
429 Too Many Requests response.
Performance Considerations
Time Windows
PostHog automatically optimizes queries using progressive time windows. The API:- Starts with a small time window (1 minute)
- Progressively expands if insufficient results are found
- Caches successful window sizes for future requests
Best Practices
- Always specify time range: Use
afterandbeforeto limit the data scanned - Use appropriate limits: Don’t request more data than needed
- Filter early: Apply
eventanddistinct_idfilters to reduce result sets - Use timestamp pagination: Avoid offset-based pagination for large datasets
- Consider the Query endpoint: For complex analysis, use
/api/projects/:id/queryinstead
CSV Export
Request events in CSV format by setting theAccept header:
Migration to Query Endpoint
If you’re using the List Events endpoint, consider migrating to the Query endpoint for better performance and capabilities:- Better performance for complex queries
- More powerful filtering with HogQL
- Aggregation capabilities
- Better caching
- Lower rate limits