GraphQL profiles
Select public profile highlights, games, and recent activity.
The GraphQL endpoint is https://api.egdata.app/graphql. Use profile(id:) to fetch the fields needed for a profile page in one request.
const query = `query Profile($id: ID!) {
profile(id: $id) {
accountId
displayName
highlights { level totalXP totalGames totalAchievements totalPlatinums }
featuredGames(limit: 6) {
sandboxId title completionPercent earnedXP totalXP hasPlatinum
}
recentActivity(limit: 8) { type sandboxId gameTitle occurredAt }
}
}`;
const response = await fetch("https://api.egdata.app/graphql", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ query, variables: { id: "epic-account-id" } }),
});
const result = await response.json();The response places selected fields under data.profile. The profile is null when it cannot be found or is unavailable; profiles without imported achievement data can have empty game and activity lists.
{
"data": {
"profile": {
"accountId": "epic-account-id",
"displayName": "Player",
"highlights": { "level": 12, "totalGames": 8 },
"featuredGames": [],
"recentActivity": []
}
}
}Profile lists accept limit up to 100. games and achievements also accept 1-based page values. Featured and library games accept filter (ALL, COMPLETED, NEAR_PLATINUM, IN_PROGRESS, PLATINUM) and sort (COMPLETION, ALPHABETICAL, XP, ACHIEVEMENTS). Recent activity currently includes achievement unlocks and platinum awards.