Getting User Presence Data
Simply send a GET request to users endpoint with your user ID
. This is for the REST API, if you want to check the WebSocket documentation to get real-time updates, click here.
JavaScript Code
fetch("https://api.lanyard.rest/v1/users/162969778699501569")
.then((res) => res.json())
.then(console.log);
Interactive Playground
GET https://api.lanyard.rest/v1/users/:user_id
{ "data": { "kv": { "lanyardOwner": "yes" }, "spotify": null, "discord_user": { "id": "162969778699501569", "username": "eggsydev", "avatar": "a_5a915f09f9a2bdf1c05e65d75ffd7101", "discriminator": "0", "bot": false, "clan": null, "global_name": "EGGSY", "avatar_decoration_data": null, "display_name": "EGGSY", "public_flags": 4326144 }, "activities": [ { "id": "custom", "name": "Custom Status", "type": 4, "state": "github.com/eggsy", "emoji": { "id": "772550034699845642", "name": "githubwhite", "animated": false }, "created_at": 1723453623595 } ], "discord_status": "online", "active_on_discord_web": false, "active_on_discord_desktop": true, "active_on_discord_mobile": false, "listening_to_spotify": false }, "success": true }