Wrapped API
The wrapped API for consumer 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, achievements, and longest streak — all you build is the UI. Start for free, scale 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: 2026,
});
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: 2026).
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 achievements.
activity.entireYearobjectFull-year summary with metrics, points, achievements, 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: 2026
});
// Response:
// {
// user: {...},
// activity: {
// daysActive: 156,
// weeksActive: 42,
// monthsActive: 7,
// mostActiveDay: {...},
// mostActiveWeek: {...},
// mostActiveMonth: {...},
// entireYear: {
// metrics: {...},
// points: {...},
// achievements: [...],
// leaderboards: {...},
// longestStreak: {...}
// }
// }
// }Lightning-fast integration
Simple APIs you'll love
Use our pre-built gamification platform to effortlessly build engaging user experiences. Get a team that's 100% focused on engagement.
- Type-safe SDKs.
- We spend time worrying about abstractions and let you focus on what matters: building a great experience for your users.
- Intuitive documentation.
- Documentation built by developers for developers. Get started in minutes, not hours.
- Effortless debugging.
- Get to the root of the issue fast with detailed event logs and error messages.
// Build a wrapped experience
const wrapped = await trophy.users
.wrapped(userId, { year: 2026 });
return (
<WrappedCard
daysActive={wrapped.activity.daysActive}
longestStreak={wrapped.activity.entireYear.longestStreak}
achievements={wrapped.activity.entireYear.achievements}
/>
);Built for production workloads
Reliable infrastructure designed for performance at scale.
- Uptime SLA
- 99.99%
- p95 API Latency
- 200ms
- Monthly API Requests
- 150M
- Users Tracked
- 1M+
FAQ
Frequently asked questions
Have a different question and can’t find the answer you’re looking for? Send us an email.
Get started