Endpoint
Parameters
Path Parameters
| Parameter | Type | Description |
|---|---|---|
tenantId | string | Your tenant identifier (use the alias shown on your dashboard) |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
event | string | No | Filter by specific event name |
after | string | No | Start date (YYYY-MM-DD format) |
before | string | No | End date (YYYY-MM-DD format) |
filterSet | array | No | Array of filter objects |
Filter Object
| Field | Type | Required | Description |
|---|---|---|---|
property | string | Yes | Property path to filter on |
comparison | string | Yes | Comparison operator |
value | any | Yes | Value to compare against |
Response
Returns a simple count object:When to Use Count vs Query
✅ Use Count Endpoint For:
- Aggregations: Getting totals, averages, or other metrics
- Dashboard widgets: Displaying numbers without needing event details
- Performance monitoring: Checking if thresholds are exceeded
- Quick checks: Verifying if events exist without fetching them
❌ Use Query Endpoint For:
- Event details: When you need the actual event data
- User journeys: Analyzing sequences of events
- Data export: When you need to process individual events
- Debugging: Investigating specific event properties
Examples
Basic Count
Count all page views in a date range:Filtered Count
Count high-value purchases:Multiple Filters
Count events from specific users on mobile devices:Conversion Rate Calculation
Calculate conversion rates by comparing counts:Code Examples
JavaScript/TypeScript
Python
Node.js
Dashboard Metrics
Use the count endpoint to build dashboard metrics:Performance Monitoring
Monitor system health with count queries:A/B Testing
Use count queries to analyze A/B test results:Error Handling
Handle count query errors gracefully:Performance Tips
1. Use Date Ranges
Always include date ranges to limit the data scanned:2. Be Specific with Filters
Use specific filters to reduce the dataset:3. Cache Results
Cache count results for frequently accessed metrics:Custom Plans
Need higher rate limits for your count queries? We offer custom plans with:- Higher rate limits: Custom requests per minute/day limits
- Dedicated support: Priority support and SLA guarantees
- Volume discounts: Competitive pricing for high-volume usage
Next Steps
Query Events
Learn how to query events with filters
List Events
Discover available event types
Filter Reference
Complete guide to all filter operators
Custom Dashboard
Build a custom analytics dashboard