API
A small JSON API for creating and managing pastes from scripts, editors and CI. Every account gets it; Free is enough for a few pastes a day, Pro is for automation.
| Free account | Pro | |
|---|---|---|
| Requests per day (per key) | 25 | 5000 |
| Active API keys | 1 | 5 |
| Create, read, update, delete pastes | ✓ | ✓ |
| Paste size / daily paste quota | 64 KB / 20 a day | 2 MB / unlimited |
| Private pastes, per-paste passwords, custom header/footer, never-expire | — | ✓ |
Print-ready HTML export (/html/) | — | ✓ |
Authentication
Create a key under API keys and send it as a bearer token. Keys are shown once and stored hashed.
curl -H "Authorization: Bearer psp_..." https://pasteshareprint.com/api/v1/me/
Every response carries X-RateLimit-Limit and X-RateLimit-Remaining. Errors are JSON: {"error": "...", "code": "..."} with codes unauthorized (401), plan_required (403), not_found (404), validation_error (400), paste_quota or rate_limited (429).
Endpoints
| Method | Path | What it does |
|---|---|---|
| GET | /api/v1/me/ | Your plan, limits and today's usage. |
| GET | /api/v1/pastes/ | List your pastes. ?page=1&per_page=20 (max 100). |
| POST | /api/v1/pastes/ | Create a paste. Returns 201 with the paste and its URLs. |
| GET | /api/v1/pastes/<slug>/ | One paste including content. Works for your own pastes and any public or unlisted paste without a password. |
| PATCH / PUT | /api/v1/pastes/<slug>/ | Update any of the fields below on your own paste. |
| DELETE | /api/v1/pastes/<slug>/ | Delete your paste. Returns 204. |
| GET | /api/v1/pastes/<slug>/html/ | Pro. Standalone print-ready HTML with absolute asset URLs, ready for a headless browser or PDF tool. |
Paste fields
| Field | Values | Default |
|---|---|---|
content | string (required) | |
title | string, up to 200 chars | empty |
format | markdown, plain, code | markdown |
language | Pygments lexer name for code, or auto | auto |
theme | modern; Pro adds oldstyle, plain | modern |
paper_size | a4, letter; Pro adds legal, a5 | a4 |
visibility | public, unlisted; Pro adds private | unlisted |
expiry | 1h, 1d, 7d, 30d, never (within your plan's limit) | plan maximum |
burn_after_read | true / false. Deleted the first time a non-owner opens it (after a confirmation step). | false |
folder | folder name (Pro); created if it does not exist. null or "" unfiles. | none |
password | string (Pro). Empty string removes it on update. | none |
header_text, footer_text | string, up to 200 chars (Pro) | empty |
Examples
Create a Markdown paste
curl -X POST https://pasteshareprint.com/api/v1/pastes/ \
-H "Authorization: Bearer psp_..." \
-H "Content-Type: application/json" \
-d '{"title": "Release notes", "content": "# v2.0\n\n- Faster printing", "paper_size": "letter", "expiry": "7d"}'
Upload a file as source code
python3 - <<'EOF'
import json, urllib.request
body = json.dumps({"title": "app.py", "format": "code", "language": "python", "content": open("app.py").read()}).encode()
req = urllib.request.Request("https://pasteshareprint.com/api/v1/pastes/", body, {"Authorization": "Bearer psp_...", "Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(req))["url"])
EOF
Turn a paste into a PDF (Pro)
curl -H "Authorization: Bearer psp_..." https://pasteshareprint.com/api/v1/pastes/SLUG/html/ > paste.html chromium --headless --no-pdf-header-footer --print-to-pdf=paste.pdf paste.html
Response shape
{
"slug": "F623vK0K",
"title": "Release notes",
"format": "markdown",
"paper_size": "letter",
"visibility": "unlisted",
"expires_at": "2026-09-12T05:14:13Z",
"url": "https://pasteshareprint.com/p/F623vK0K/",
"raw_url": "…/p/F623vK0K/raw/",
"print_url": "…/p/F623vK0K/print/",
"content": "# v2.0 …"
}