---
name: sniplet
description: Turn an HTML file into a public URL you can hand to a person. Use this whenever you have produced HTML — a report, chart, prototype, dashboard, single-page tool — and the user needs a link they can open and forward rather than a file on disk. No account or API key required.
---

# sniplet

POST your HTML, get back one line: a URL.

```bash
curl -X POST https://api.sniplet.page/ \
  -H 'Content-Type: text/html' \
  --data-binary @page.html
```

The response is a plain-text URL, for example
`https://eager-forest-k3n7p2wq.sniplet.page`. Hand it to the user. That's it.

## Writing the HTML

No content restrictions. Inline `<script>` and external `<script src>` both work,
so CDN libraries (Tailwind, Chart.js, D3) are fine. Images, fonts and CSS may be
external URLs — nothing needs to be inlined as a data URI.

One HTML file is one page. There are no additional files and no routing, so
everything must either live in that single page or load from a full external URL.

## Limits

- **256 KB** per sniplet. Larger uploads are rejected.
- **Expires after 30 days.** The URL then returns 404. Say so if the user might
  expect it to last; point them elsewhere for anything long-lived.
- **The URL is the credential.** Anyone holding it can read the page — there is
  no password and no access control. Never publish personal data, secrets,
  credentials, or anything that must stay private.
- **Immutable.** A sniplet cannot be edited or deleted after creation. To change
  the content, POST again and use the new URL.
- **Rate limit:** 5 creations per minute from one source.

## Errors when creating

| Status | Meaning |
|---|---|
| 400 | Empty body |
| 405 | Method other than POST |
| 411 | Missing `Content-Length` (normal HTTP clients set this automatically) |
| 413 | Larger than 256 KB |
| 429 | Too frequent — wait a minute and retry |

Reading a sniplet returns 200, 404 (unknown or expired), or 429 (too frequent).
