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 accountPro
Requests per day (per key)255000
Active API keys15
Create, read, update, delete pastes
Paste size / daily paste quota64 KB / 20 a day2 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

MethodPathWhat 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

FieldValuesDefault
contentstring (required)
titlestring, up to 200 charsempty
formatmarkdown, plain, codemarkdown
languagePygments lexer name for code, or autoauto
thememodern; Pro adds oldstyle, plainmodern
paper_sizea4, letter; Pro adds legal, a5a4
visibilitypublic, unlisted; Pro adds privateunlisted
expiry1h, 1d, 7d, 30d, never (within your plan's limit)plan maximum
burn_after_readtrue / false. Deleted the first time a non-owner opens it (after a confirmation step).false
folderfolder name (Pro); created if it does not exist. null or "" unfiles.none
passwordstring (Pro). Empty string removes it on update.none
header_text, footer_textstring, 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 …"
}