Get Dashboard Metrics
Authentication
Required. User can only access their own analytics.Response
Total number of jobs tracked.
Week-over-week change in applications (percentage).Example:
15.3 means 15.3% increaseCount of unique companies with non-rejected status.
Week-over-week change in active companies (percentage).
Percentage of applications that reached interview or offer stage.Range: 0-100
Week-over-week change in interview rate (percentage points).
Average AI match score across all scored jobs.Range: 0-100
Week-over-week change in average match score (points).
Percentage of applications that received a response (interview, offer, or rejection).Range: 0-100
Average days between application and first response.Calculated from
applied_at to interview_at for jobs with both timestamps.Job count breakdown by status.
Job count breakdown by source, sorted descending by count.
Daily application counts for the last 30 days.
Status breakdown over time for stacked charts.
Last 10 significant events (job created, status changed, AI scored).
Example Response
Performance Notes
- Caching: Response includes
Cache-Control: private, max-age=60, stale-while-revalidate=120header - Safety Cap: Fetches max 1,000 jobs to prevent memory exhaustion
- Optimization: Long-term plan is to move aggregation to SQL
GROUP BYqueries
Status: ✅ Live
This endpoint is fully implemented. Seeapp/api/analytics/dashboard/route.ts:33.
Get Timeline Data
Authentication
Required. User can only access their own timeline.Query Parameters
Time period to fetch.Values:
7d— Last 7 days30d— Last 30 days90d— Last 90 daysall— All time (from 2020-01-01)
Response
Array of daily data points, sorted by date ascending.
Requested period (echoed from query param).
Example Response
Performance Notes
- Safety Cap: Limits to 5,000 rows (prevents unbounded fetches for
period=all) - Grouping: Groups by date on the client side; consider moving to SQL
GROUP BYfor large datasets
Status: ✅ Live
This endpoint is fully implemented. Seeapp/api/analytics/timeline/route.ts:11.
Errors
All analytics endpoints return standard error responses:Common Errors
- 401 Unauthorized — Missing or invalid auth token
- 500 Internal Error — Database error