Lanyard (Discord Presence) API
Free Discord presence API with no key: online status, activities, Spotify track and a per-user key-value store, over REST or WebSocket. Tested example included.
Endpoint tested and returned HTTP 200 on 21 Aug 2026
What is the Lanyard (Discord Presence) API?
Lanyard exposes a Discord user's live presence — status, current activities, and Spotify playback — as plain REST JSON with no API key. It only works for users who have joined the Lanyard Discord server, which is how they opt in.
Discord has no public way to read someone's presence without running a bot, which is why so many personal sites gave up on the "here is what I'm listening to right now" widget. Lanyard solves it by running that bot once, centrally: join their Discord server and your presence becomes readable at a plain URL that anyone can fetch from browser JavaScript.
Two things make it more than a novelty. First, there is a WebSocket alongside the REST endpoint, so a widget can update the moment your status changes rather than polling. Second, every monitored user gets a small key-value store — the `kv` object — which Lanyard serves back verbatim; people use it for social links, a status note, or whatever their site needs. Since the KV content is arbitrary user data of arbitrary size, treat it as untrusted and do not assume it is small.
Quick facts
- Base URL
https://api.lanyard.rest/v1- Authentication
- No API key to read presence. Writing to your own KV store needs a token issued by the Lanyard bot; reads are open.
- Rate limit
- No published limit on reads. Use the WebSocket rather than tight polling if you need live updates.
- Pricing
- Free. Lanyard is open source and can be self-hosted if you would rather not depend on the public instance.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the Lanyard (Discord Presence) API
Every request below was executed against the live API on 21 Aug 2026, and the response shown is the real body it returned — not an illustration.
1. Read a monitored user's Discord presence
GET https://api.lanyard.rest/v1/users/156114103033790464
curl 'https://api.lanyard.rest/v1/users/156114103033790464'const res = await fetch("https://api.lanyard.rest/v1/users/156114103033790464");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://api.lanyard.rest/v1/users/156114103033790464", timeout=20)
res.raise_for_status()
print(res.json()){
"data": {
"kv": {
"discord": "https://dstn.to/discord",
"github": "https://github.com/dustinrouillard",
"ip": "::1",
"lanyard": "wtf",
"note": "I make things, or something like that",
"riderr": "https://riderr.app",
"twitter": "https://twitter.com/dustinrouillard",
"website": "https://dstn.to"
},
"discord_user": {
"avatar": "23d093e9b8bc09e0341e1ce18b217602",
"avatar_decoration_data": {
"asset": "a_e3ec2d8cccdcb68819b2910c0787d3a4",
"expires_at": null,
"sku_id": "1531403489727746310"
},
"bot": false,
"collectibles": {
"nameplate": {
"asset": "nameplates/spectrum_array/1531411317477478654/",
"expires_at": null,
"label": "Red and orange light waves ripple and sparkle",
"palette": "bubble_gum",
"sku_id": "1531411317477478654"
}
},
"discriminator": "0",
"display_name": "Dustin",
"display_name_styles": {
"colors": [
1874155
],
"effect_id": 5,
"font_id": 8
},
"global_name": "Dustin",
"id": "156114103033790464",
"primary_guild": null,
"public_flags": 131648,
"username": "dstn.to"
},
"activities": [
{
"content_classification": {
"data": null,
"loaded": true
},
"created_at": 1787298783475,
"emoji": {
"name": "📸"
},
"id": "custom",
"name": "Custom Status",
"session_id": "ab5f6bab10da05f7eb780af56cParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
(user id) | path | Required | Discord snowflake id of a user who has joined the Lanyard Discord server. 156114103033790464 |
Response fields
data.discord_userobject- Username, global name, avatar hash and public flags. Build the avatar URL from `id` and `avatar`.
data.discord_statusstring- `online`, `idle`, `dnd` or `offline`.
data.activitiesarray- Current activities. Type 4 is the custom status; type 2 is listening. Playing a game shows up here with its name and timestamps.
data.listening_to_spotifyboolean- Convenience flag, mirrored by a richer `spotify` object with track, artist, album art and start/end timestamps.
data.active_on_discord_web / _desktop / _mobileboolean- Which clients the user is connected from.
data.kvobject- Arbitrary user-controlled key-value pairs. Values can be long — one documented user stores a full synced-lyrics blob here.
success / errorboolean / object- An unmonitored user id returns `success: false` with `error.code` set to `user_not_monitored`.
What you can build with the Lanyard (Discord Presence) API
- Show a live "currently listening on Spotify" card on a personal site
- Display an online/offline dot next to a profile
- Drive a status widget from the WebSocket instead of polling
- Read your own KV store to publish social links from one place
Common errors and how to fix them
`user_not_monitored`
That Discord user has not joined the Lanyard Discord server.
Fix: Presence is opt-in and there is no way around it. Only monitored users return data.
Everything null while the user is clearly online
Discord only broadcasts presence when the user allows it, and invisible mode reports as offline.
Fix: Treat `offline` as "not visible", not as "definitely not there".
Huge response
The `kv` store holds arbitrary user content.
Fix: Do not assume a small payload. Cap what you read and render, and never inject KV values into a page unescaped.
Stale data when polling
REST returns a snapshot.
Fix: Use the WebSocket gateway for anything that should feel live; polling every few seconds is both slower and ruder.
Lanyard (Discord Presence) API — frequently asked questions
Do I need an API key for Lanyard?
No. Reading presence needs nothing at all. Writing to your own key-value store requires a token you get from the Lanyard bot, but that is a separate concern.
Why does my Discord id return user_not_monitored?
Lanyard can only see users who have joined its Discord server — that membership is the opt-in. Join the server and your id starts returning data within moments.
Can I get live updates instead of polling?
Yes. Lanyard runs a WebSocket gateway that pushes presence changes as they happen, which is the intended way to drive a live widget.
Is it safe to render the kv values directly?
No. They are arbitrary strings set by the user, so escape them like any other untrusted input and be prepared for values much larger than you expect.
Tools that pair with this API
Discord Timestamp Generator
Turn any date and time into Discord timestamp tags that show in each reader's own timezone — all seven formats previewed live with copy buttons.
Discord Embed Generator
Build Discord webhook embed JSON with a live preview: title, colour, author, fields, images, footer and timestamp, with every character limit checked.
Discord Text Formatter
Build Discord markdown — bold, italic, underline, spoilers, quotes — plus colored text with ANSI code blocks. Live preview and copy-ready output.
Alternatives to Lanyard (Discord Presence) API
If Lanyard (Discord Presence) does not fit, these social media apis cover similar ground. Every one was called before publishing, and each links to its own reference page with a working curl command and the response it returned.
| API | What it does | Auth | CORS | Last verified |
|---|---|---|---|---|
| Mastodon | Free Mastodon API: public timelines, instance metadata, trending hashtags and account data from any Mastodon server with no key for public endpoints. Tested. | No key | No | 19 Aug 2026 |
| Lemmy | Free Lemmy API with no key: posts, comments, communities and site data from any federated Lemmy instance. A Reddit-style API without gatekeeping. Tested. | No key | No | 19 Aug 2026 |
| DEV Community | Free DEV.to API with no key for public content: articles, tags, users and comments from the developer community platform. Tested curl example and live JSON. | No key | Yes | 19 Aug 2026 |
| Bluesky Public API | Free Bluesky public API with no key: profiles, posts, followers and feeds from the AT Protocol network. No authentication for public data. Tested example. | No key | Yes | 19 Aug 2026 |
| joinmastodon Servers | Free Mastodon server directory API with no key: browse vetted fediverse instances with user counts, languages, categories and open registration status. Tested. | No key | Yes | 20 Aug 2026 |
| Matrix Client-Server Versions | Free unauthenticated Matrix endpoint listing the spec versions and unstable features a homeserver supports — the first call any Matrix client makes. Tested example included. | No key | Yes | 21 Aug 2026 |
Lanyard (Discord Presence) is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 21 Aug 2026; always check the official documentation before relying on this API in production, as terms and limits can change.