Public endpoints

The visitor-facing endpoints a published profile exposes - rendered page, Open Graph card, live Discord presence, the SSE stream, and the embedded music proxy.

Public endpoints

A published profile exposes a handful of unauthenticated endpoints to visitors and their browsers. None of them take an API key. Access is governed entirely by the profile row: it must be published (is_public), not suspended, and not expired. Contact-form POSTs are documented separately on Contact forms.

The rendered profile page

GEThttps://<slug>.hep.gg/Public
Server-rendered public profile page.

The profile site itself. It is host-routed, not path-routed: the API matches the request's Host header against profiles.domain (case-insensitive) and renders the matching published profile. The same *.hep.gg subdomain can serve a profile at / and uploader files at /<shortid> in parallel.

  • No body, no query parameters. The page is driven entirely by the Host header.
  • Returns 200 with Content-Type: text/html; charset=utf-8 and Cache-Control: no-store.
  • Each render records a view (per IP and User-Agent, with a naive 30-second dedup to keep refresh spam from inflating counts). The optional Referer and User-Agent headers are captured.
  • The page head includes Open Graph and Twitter card tags; og:image and twitter:image point at the OG image endpoint, and twitter:card is summary_large_image.
  • If no published profile matches the host, the request falls through (404, or a redirect to hep.gg for unmatched custom domains). The hep.gg apex and other exempt root domains always fall through to the dashboard.

Premium-gated features degrade gracefully for non-premium owners: the Discord presence card is hidden and the "Powered by Hep.gg" footer is forced visible. See visibility and availability.

Open Graph image

GEThttps://hep.gg/api/v1/profiles/:profileID/og.pngPublic
Social-share card image for a profile.

Every public profile auto-exposes a social card as a PNG. The rendered page references this URL as its og:image, so Discord, Twitter/X, Facebook, and other crawlers fetch it when someone shares the profile link. Presence and activity cards and the powered-by footer are forced off in this render so the image stays static.

Path parameters
profileID
stringrequired
The profile's ID (profiles.id).
  • Returns 200 with Content-Type: image/png and Cache-Control: public, max-age=300.
  • Returns 404 with body Not found if the profile is missing, suspended, or not public.
  • Returns 500 with body Render failed if image rendering errors.
curl
curl -o card.png https://hep.gg/api/v1/profiles/PROFILE_ID/og.png

Live Discord presence (snapshot)

GEThttps://hep.gg/api/v1/profiles/presence/:userIDPublic
One-shot Discord presence snapshot for a profile owner.

Returns the profile owner's current Discord presence. Backed by a Redis cache with a 5-minute TTL, populated by the Hep.gg Discord bot's presence listener. The owner must have Discord presence sharing enabled on the bot for this to return anything.

Path parameters
userID
stringrequired
The profile owner's Hep.gg user ID (their Discord-linked account ID).

Returns 200 with the standard envelope. data.presence is a PresenceSnapshot object, or null when the cache is empty or expired.

200 response
{
  "ok": true,
  "data": {
    "presence": {
      "status": "online",
      "activity": {
        "name": "Spotify",
        "type": 2,
        "details": "Song Title",
        "state": "Artist Name",
        "startedAt": 1716900000000,
        "endsAt": 1716900210000,
        "largeImage": "https://i.scdn.co/image/...",
        "largeText": "Album Name"
      },
      "updatedAt": "2026-05-29T12:00:00.000Z"
    }
  }
}

Presence snapshot

PresenceSnapshot fields
status
stringoptional
One of online, idle, dnd, offline.
activity
objectoptional
Present only when the owner has an active Discord activity. See below.
updatedAt
stringoptional
ISO 8601 timestamp of when the snapshot was written to cache.
activity fields
name
stringoptional
Activity name, e.g. Spotify, Visual Studio Code.
type
numberoptional
Discord activity type: 0 Playing, 1 Streaming, 2 Listening, 3 Watching, 4 Custom (text is in state), 5 Competing.
details
stringoptional
Optional first detail line.
state
stringoptional
Optional second detail line. For custom status, holds the status text.
startedAt
numberoptional
Optional Unix epoch in milliseconds for when the activity started. Useful for an elapsed-time ticker.
endsAt
numberoptional
Optional Unix epoch in milliseconds for when the activity ends. Present for playback with a known finish time (e.g. Spotify).
largeImage
stringoptional
Optional large image asset reference. For Spotify this is the album art URL.
largeText
stringoptional
Optional large image hover text. For Spotify this is the album name.

Live Discord presence (SSE stream)

GEThttps://hep.gg/api/v1/profiles/presence/:userID/streamPublic
Server-Sent Events stream of presence updates.

A Server-Sent Events stream so a profile page can update its presence card live without polling. The server sends an initial snapshot on connect, then pushes a new event whenever the owner's presence changes, plus a keepalive comment every 30 seconds.

Path parameters
userID
stringrequired
The profile owner's Hep.gg user ID.
  • Returns 200 with Content-Type: text/event-stream, Cache-Control: no-store, Connection: keep-alive.
  • Returns 400 with { "ok": false, "error": "userID required" } if userID is missing.
  • Each presence event is event: presence followed by a data: line containing a PresenceSnapshot JSON object.
  • Keepalive pings are SSE comment lines (: ping) sent every 30 seconds.
event stream
event: presence
data: {"status":"online","activity":{"name":"Spotify","type":2},"updatedAt":"2026-05-29T12:00:00.000Z"}
 
: ping
 
event: presence
data: {"status":"idle","updatedAt":"2026-05-29T12:01:30.000Z"}
curl
curl -N https://hep.gg/api/v1/profiles/presence/USER_ID/stream

Embedded music proxy

GEThttps://hep.gg/api/v1/profiles/:profileID/music/:isrcPublic
Audio stream proxy for music embedded on a profile.

The audio source for music embedded on a public profile. The rendered <audio> tag points here and the browser hits it anonymously. Server-side, Hep.gg uses the profile owner's music key to fetch the audio. Plays count against the owner's music stats, and revoking the owner's music access cleanly disables profile audio.

Path parameters
profileID
stringrequired
The profile's ID (profiles.id).
isrc
stringrequired
The track ISRC. Must match ^[A-Z0-9]{12}$ (case-insensitive).
  • GET and HEAD are both supported.
  • The upstream worker's response is streamed back with its status passed through. A Range request header is forwarded best-effort (the music worker does not currently honor Range).
  • These upstream headers are forwarded to the browser: content-type, content-length, content-range, accept-ranges, last-modified, etag, x-track-title, x-track-artist, x-track-duration, x-track-album, x-track-artwork.
  • Returns 400 (empty body) on a missing profileID or an ISRC that fails the pattern.
  • Returns 404 (empty body) if the owner has no enabled music key (or the profile is not public/suspended/expired).
  • Returns 502 (empty body) on upstream failure.
curl
curl -o track.mp3 https://hep.gg/api/v1/profiles/PROFILE_ID/music/USRC17607839