Wrapped API
The wrapped API for consumer web and mobile apps
Trophy's year-in-review API aggregates your users' entire year of activity into a shareable wrapped recap automatically. You get back days active, highlights, milestones, and longest streak — all you build is the UI. Scales to millions of users.
Quickstart
Quickstart: track activity and fetch Wrapped
Keep sending metric events throughout the year. When you are ready to render a recap, fetch the user’s aggregated Wrapped summary for that year.
import { TrophyApiClient } from "@trophyso/node";
const trophy = new TrophyApiClient({ apiKey: process.env.TROPHY_API_KEY });
// 1. Track activity as usual — Wrapped aggregation runs in the background
await trophy.metrics.event("lessons", {
user: { id: "user-123" },
value: 1,
});
// 2. Fetch the year-in-review summary when you are ready to render
const wrapped = await trophy.users.wrapped("user-123", {
year: 2027,
});
console.log("Days active:", wrapped.activity.daysActive);
console.log("Longest streak:", wrapped.activity.entireYear.longestStreak);
console.log("Achievements:", wrapped.activity.entireYear.achievements);Buy vs. build
Why use Trophy's wrapped API?
Building a year in review API from scratch means writing aggregation pipelines, computing highlights, and generating personalised annual recaps for your entire user base at once — typically a multi-week engineering project every year.
Integration Time
Reliability
Scalability
Ongoing Maintenance
Feature Development
Endpoints
Wrapped endpoints
Use Trophy's wrapped API to fetch a complete user activity summary for any year. Aggregation runs automatically in the background — call the endpoint when you're ready to render.
Send a metric event to track user activity and power wrapped recaps.
Path Parameters
keystringrequiredUnique reference of the metric as set when created.
Request Body
userUserrequiredThe user that triggered the event (must include id).
valuenumberrequiredThe value to add to the user's current total for the given metric.
Response
eventIdstringUnique identifier for the created event.
totalnumberThe user's new total for this metric.
import { TrophyApiClient } from '@trophyso/node';
const trophy = new TrophyApiClient({
apiKey: 'YOUR_API_KEY'
});
// Track a user event
await trophy.metrics.event("lessons", {
user: {
id: "user-123"
},
value: 1
}
);
// This single event:
// - Records user activity
// - Computes wrapped data
Get a user's year-in-review wrapped data including activity breakdown, highlights, and comparisons.
Path Parameters
idstringrequiredThe user's ID in your database.
Query Parameters
yearintegerYear to get wrapped data for (default: 2027).
Response
userUserThe user's profile data.
activity.daysActivenumberTotal days the user was active during the year.
activity.mostActiveDayobjectThe user's most active day with metrics, points, and milestones.
activity.entireYearobjectFull-year summary with metrics, points, milestones, and longest streak.
import { TrophyApiClient } from '@trophyso/node';
const trophy = new TrophyApiClient({
apiKey: 'YOUR_API_KEY'
});
// Fetch user's wrapped data
const wrapped = await trophy.users.wrapped("user-123", {
year: 2027
});
// Response:
// {
// user: {...},
// activity: {
// daysActive: 156,
// weeksActive: 42,
// monthsActive: 7,
// mostActiveDay: {...},
// mostActiveWeek: {...},
// mostActiveMonth: {...},
// entireYear: {
// metrics: {...},
// points: {...},
// achievements: [...],
// leaderboards: {...},
// longestStreak: {...}
// }
// }
// }Built for production workloads
Reliable infrastructure designed for performance at scale.
- Uptime SLA
- 99.9%
- p95 API Latency
- 200ms
- Monthly API Requests
- 180M
- Users Tracked
- 1M+
What is a Wrapped experience?
A wrapped feature is a personalised year-in-review summary for each user — similar to Spotify Wrapped. It surfaces their activity, milestones, streaks, and personal bests across the year in a format designed to be shared. Trophy generates the underlying data automatically from the metric events you send throughout the year.
How do I build a Spotify Wrapped-style feature for my app?
Trophy's year in review API does the aggregation work automatically. Call the wrapped endpoint with a user ID and year, and you get back a complete annual user recap — days active, most active periods, milestones earned, longest streak, and more. You focus entirely on the UI.
What data is included in the Wrapped response?
The user activity summary includes total days, weeks, and months active; the most active day, week, and month with detailed metric breakdowns; full-year totals for metrics, points, and milestones; leaderboard standings; and longest streak data. Everything needed to build a compelling annual recap.
Do I need to do anything special to enable Wrapped?
No. As long as you're sending metric events to Trophy throughout the year, the data needed to power an app wrapped feature is accumulated automatically. Call the API when you're ready to build your year-in-review experience — no backfilling or additional setup needed.
Can users share their Wrapped recap?
Trophy provides the data — you design the shareable wrapped experience. Most teams build a dedicated page or card that users can screenshot or share via link. The API returns all the stats needed to create compelling, personalised content: streaks, milestones, most active periods, and full-year totals.
Can I build Wrapped experiences in React, React Native, or mobile apps?
Yes. Building wrapped experiences with Trophy uses server-side SDKs (Node.js, Python, Go, Java, PHP, Ruby, and .NET) to fetch the annual recap from your backend. The API returns activity summaries, highlights, and stats that you can render in any frontend — React, React Native, Next.js, Swift, Kotlin, Flutter, or any other framework.