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.
| Method | Path | Description |
|---|---|---|
POST | /api/paste | Create 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 titlelanguage— language key orauto(default: auto)burn_after—1deletes on first viewexpiry— seconds: 0, 3600, 86400, 604800, 2592000, 7776000, 15552000, 31536000indexable—1to 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
| Method | Path | Description |
|---|---|---|
POST | /api/shorten | Shorten a URL |
GET | /api/shorten/{code} | Retrieve short URL metadata |
url— required; full http(s) URLtitle— optional labelexpiry— 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
| Method | Path | Description |
|---|---|---|
POST | /api/image | Upload an image (JPEG, PNG, GIF, WebP; max 10 MB) |
GET | /api/image/{code} | Retrieve image metadata |
image— required; multipart file fieldtitle— optional, max 255 charsexpiry— seconds from the list aboveindexable—1to 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.