Read a paste
Fetch a paste's rendered reader page or its raw bytes from paste.hep.gg. The raw endpoint is the programmatic read path.
Every paste has two read URLs: a rendered HTML reader page for humans, and a raw plaintext endpoint for scripts. Public and unlisted pastes need no authentication. Private pastes are readable only by their owner's signed-in session.
The paste ID in the path is the value you got back as data.id (or the tail of
data.url) when you created it. IDs match [A-Za-z0-9_-] and are 4 to 80
characters long.
Reader page
https://paste.hep.gg/:idPublicReturns text/html: a syntax-highlighted reader page with the title, language,
view count, created and expiry timestamps, and size. It ships both a dark and a
light rendering and swaps by the visitor's prefers-color-scheme. This is what
opening the link in a browser shows.
A missing, expired, or not-visible paste returns 404 with an HTML
not-found page.
Raw content
https://paste.hep.gg/:id/rawPublicReturns text/plain; charset=utf-8 with the paste content and no markup. This
is the endpoint to hit from curl, wget, or any program that wants the
original bytes.
- Public pastes are served with
Cache-Control: public, max-age=60, so a repeated fetch within a minute may come from cache. - Unlisted and private pastes are served
no-store. - A missing, expired, or not-visible paste returns
404with the plaintext bodyNot found.
curl https://paste.hep.gg/aB3dE6kp/rawconst res = await fetch("https://paste.hep.gg/aB3dE6kp/raw");
if (res.status === 404) throw new Error("paste not found or expired");
const content = await res.text();
console.log(content);Pull a config or script down and run it in one line:
curl -fsSL https://paste.hep.gg/aB3dE6kp/raw | bashVisibility and access
| Paste visibility | GET /<id> and GET /<id>/raw |
|---|---|
public | Readable by anyone. Raw response is cacheable for 60s. |
unlisted | Readable by anyone with the link. Not cached. |
private | Readable only by the owner (signed-in session). Others get 404. |
There is no JSON metadata endpoint on the public host. To list your own pastes
or fetch their metadata, use the dashboard or the session-authed
/api/v1/snippets API while signed in.