API & CLI Reference

Every feature on r3rr.com is available from the command line. No API key or account is required.

Paste

Create and retrieve pastes.

MethodPathDescription
POST/api/pasteCreate a paste
GET/api/paste/{code}Retrieve paste metadata and content

Fields for POST /api/paste:

  • content — required; paste text (max 512 KB)
  • title — optional title
  • language — language key or auto (default: auto)
  • burn_after — 1 deletes on first view
  • expiry — seconds: 0, 3600, 86400, 604800, 2592000, 7776000, 15552000, 31536000
  • indexable — 1 to allow indexing (ignored for burn-after and short content)
curl -F 'content=@file.py' -F 'language=python' https://r3rr.com/api/paste
cat script.sh | curl -F 'content=@-' https://r3rr.com/api/paste

Short URLs

MethodPathDescription
POST/api/shortenShorten a URL
GET/api/shorten/{code}Retrieve short URL metadata
  • url — required; full http(s) URL
  • title — optional label
  • expiry — seconds from the list above
curl -F 'url=https://example.com/long/path' https://r3rr.com/api/shorten
curl -d '{"url":"https://example.com"}' -H 'Content-Type: application/json' https://r3rr.com/api/shorten

Images

MethodPathDescription
POST/api/imageUpload an image (JPEG, PNG, GIF, WebP; max 10 MB)
GET/api/image/{code}Retrieve image metadata
  • image — required; multipart file field
  • title — optional, max 255 chars
  • expiry — seconds from the list above
  • indexable — 1 to allow indexing
curl -F 'image=@photo.jpg' https://r3rr.com/api/image
curl -F 'image=@screenshot.png' -F 'expiry=86400' https://r3rr.com/api/image

Responses

Successful creates return 201 with a JSON object containing ok, code and the relevant URLs. Validation failures return 422 with {"ok":false,"error":"…"}; rate limiting returns 429. The JSON documentation is available at /api when the Accept header does not include text/html.