CLI & API Reference

All three services are available as a JSON API — use curl or any HTTP client from Linux, BSD, macOS, or Windows.

Base URL
https://www.r3rr.com
Response format

All endpoints return application/json. Success: {"ok":true, ...}. Error: {"ok":false,"error":"..."}.

Rate limiting — each action shares a token bucket with the web interface: shorten (20 req/min), paste (10 req/min), image upload (10 req/min). Exceeding the limit returns HTTP 429.

Paste

POST /api/paste

Create a new paste. Returns JSON with the URL and raw URL.

Fields
Name Required Description
content required Paste text, max 512 KB
title optional Optional title
language optional Language key or "auto" (default: auto)
burn_after optional "1" to delete on first view
expiry optional Seconds: 0, 3600, 86400, 604800, 2592000
Examples
From a file
curl -F 'content=@file.py' -F 'language=python' https://www.r3rr.com/api/paste
From stdin
cat script.sh | curl -F 'content=@-' https://www.r3rr.com/api/paste
Burn after read
curl -F 'content=@secret.txt' -F 'burn_after=1' https://www.r3rr.com/api/paste
JSON body
curl -H 'Content-Type: application/json' -d '{"content":"echo hi","language":"bash"}' https://www.r3rr.com/api/paste
Response
{"ok":true,"code":"d2tV7Y","url":"/paste/d2tV7Y","raw_url":"/paste/d2tV7Y/raw","language":"bash","expires":null}
GET /api/paste/{code}

Retrieve paste metadata and full content as JSON.

Examples
Get paste
curl https://www.r3rr.com/api/paste/d2tV7Y
Response
{"ok":true,"code":"d2tV7Y","title":null,"language":"bash","content":"...","burn_after":false,"view_count":4,"expires_at":null,"created_at":"..."}

URL Shortener

POST /api/shorten

Shorten a URL. Returns the short URL and metadata.

Fields
Name Required Description
url required The long URL to shorten (include https://)
title optional Optional label
expiry optional Seconds: 0, 3600, 86400, 604800, 2592000
Examples
Form data
curl -F 'url=https://example.com/long/path' https://www.r3rr.com/api/shorten
JSON body
curl -H 'Content-Type: application/json' -d '{"url":"https://example.com","expiry":86400}' https://www.r3rr.com/api/shorten
Response
{"ok":true,"code":"1RsVBd","short_url":"https://www.r3rr.com/1RsVBd","long_url":"https://example.com/long/path","expires":null}
GET /api/shorten/{code}

Retrieve short URL metadata including click count.

Examples
Get info
curl https://www.r3rr.com/api/shorten/1RsVBd
Response
{"ok":true,"code":"1RsVBd","short_url":"https://www.r3rr.com/1RsVBd","long_url":"https://...","click_count":12,"expires_at":null}

Image Upload

POST /api/image

Upload an image (JPEG, PNG, GIF, WebP — max 10 MB). Must be multipart/form-data.

Fields
Name Required Description
image required Image file
expiry optional Seconds: 0, 3600, 86400, 604800, 2592000
Examples
Upload file
curl -F 'image=@photo.jpg' https://www.r3rr.com/api/image
With expiry
curl -F 'image=@screenshot.png' -F 'expiry=86400' https://www.r3rr.com/api/image
Upload from stdin
cat image.png | curl -F 'image=@-;type=image/png' https://www.r3rr.com/api/image
Response
{"ok":true,"code":"UNW2bX","url":"/image/UNW2bX","raw_url":"/image/UNW2bX/raw","mime_type":"image/jpeg","file_size":204800,"width":1920,"height":1080,"expires":null}
GET /api/image/{code}

Retrieve image metadata as JSON.

Examples
Get metadata
curl https://www.r3rr.com/api/image/UNW2bX
Response
{"ok":true,"code":"UNW2bX","url":"/image/UNW2bX","raw_url":"/image/UNW2bX/raw","mime_type":"image/jpeg","file_size":204800,"width":1920,"height":1080,"view_count":3}

Error Responses

HTTP Status Meaning
422 Unprocessable Validation failed — check the "error" field for details
404 Not Found The requested code does not exist
410 Gone The resource existed but has expired
429 Too Many Requests Rate limit exceeded — slow down
500 Server Error Something went wrong on our end