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
{ "success": true, "data": { "spotify": null, "listening_to_spotify": false, "kv": { "location": "alis house", "lanyardOwner": "yes" }, "discord_user": { "username": "EGGSY", "public_flags": 131840, "id": "162969778699501569", "discriminator": "3388", "bot": false, "avatar": "a_70183c74caccc407d8962c2ca8cb7474" }, "discord_status": "online", "activities": [ { "type": 4, "state": "github.com/eggsy", "name": "Custom Status", "id": "custom", "emoji": { "name": "githubwhite", "id": "772550034699845642", "animated": false }, "created_at": 1661803616815 } ], "active_on_discord_web": false, "active_on_discord_mobile": false, "active_on_discord_desktop": true } }