{"_path":"/api/getting-user-presence","_draft":false,"_partial":false,"_empty":false,"title":"Getting User Presence Data","description":"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.","excerpt":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"getting-user-presence-data"},"children":[{"type":"text","value":"Getting User Presence Data"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Simply send a GET request to users endpoint with your "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"user ID"}]},{"type":"text","value":". This is for the REST API, if you want to check the WebSocket documentation to get real-time updates, "},{"type":"element","tag":"a","props":{"href":"/api/working-with-websockets"},"children":[{"type":"text","value":"click here"}]},{"type":"text","value":"."}]},{"type":"element","tag":"h3","props":{"id":"javascript-code"},"children":[{"type":"text","value":"JavaScript Code"}]},{"type":"element","tag":"code","props":{"code":"fetch(\"https://api.lanyard.rest/v1/users/162969778699501569\")\n .then((res) => res.json())\n .then(console.log);\n","language":"js"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"fetch(\"https://api.lanyard.rest/v1/users/162969778699501569\")\n .then((res) => res.json())\n .then(console.log);\n"}]}]}]},{"type":"element","tag":"h3","props":{"id":"interactive-playground"},"children":[{"type":"text","value":"Interactive Playground"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"GET https://api.lanyard.rest/v1/users/:user_id"}]}]},{"type":"element","tag":"introduction-response","props":{},"children":[]}]},"head":{"meta":[{"name":"og:title","property":"og:title","content":"Getting User Presence Data"},{"name":"twitter:title","property":"twitter:title","content":"Getting User Presence Data"},{"name":"description","property":"description","content":"Get a user's Discord presence data from REST API via a GET request."},{"name":"og:description","property":"og:description","content":"Get a user's Discord presence data from REST API via a GET request."},{"name":"twitter:description","property":"twitter:description","content":"Get a user's Discord presence data from REST API via a GET request."}]},"body":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"getting-user-presence-data"},"children":[{"type":"text","value":"Getting User Presence Data"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Simply send a GET request to users endpoint with your "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"user ID"}]},{"type":"text","value":". This is for the REST API, if you want to check the WebSocket documentation to get real-time updates, "},{"type":"element","tag":"a","props":{"href":"/api/working-with-websockets"},"children":[{"type":"text","value":"click here"}]},{"type":"text","value":"."}]},{"type":"element","tag":"h3","props":{"id":"javascript-code"},"children":[{"type":"text","value":"JavaScript Code"}]},{"type":"element","tag":"code","props":{"code":"fetch(\"https://api.lanyard.rest/v1/users/162969778699501569\")\n .then((res) => res.json())\n .then(console.log);\n","language":"js"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#61AFEF"}},"children":[{"type":"text","value":"fetch"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#98C379"}},"children":[{"type":"text","value":"\"https://api.lanyard.rest/v1/users/162969778699501569\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":")"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" ."}]},{"type":"element","tag":"span","props":{"style":{"color":"#61AFEF"}},"children":[{"type":"text","value":"then"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"(("}]},{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"res"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":") "}]},{"type":"element","tag":"span","props":{"style":{"color":"#C678DD"}},"children":[{"type":"text","value":"=>"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#E5C07B"}},"children":[{"type":"text","value":"res"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#61AFEF"}},"children":[{"type":"text","value":"json"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"())"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" ."}]},{"type":"element","tag":"span","props":{"style":{"color":"#61AFEF"}},"children":[{"type":"text","value":"then"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#E5C07B"}},"children":[{"type":"text","value":"console"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"log"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":");"}]}]}]}]}]},{"type":"element","tag":"h3","props":{"id":"interactive-playground"},"children":[{"type":"text","value":"Interactive Playground"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"GET https://api.lanyard.rest/v1/users/:user_id"}]}]},{"type":"element","tag":"introduction-response","props":{},"children":[]}],"toc":{"title":"","searchDepth":2,"depth":2,"links":[{"id":"javascript-code","depth":3,"text":"JavaScript Code"},{"id":"interactive-playground","depth":3,"text":"Interactive Playground"}]}},"_type":"markdown","_id":"content:api:getting-user-presence.md","_source":"content","_file":"api/getting-user-presence.md","_extension":"md"}