Posting from scripts
Pastes are plain text. No account or key is needed; the address below is this site. Every example prints a Paste URL, a Raw URL and a Removal URL (keep that one private: opening it removes the paste).
From the shell
Pipe anything in (post to the address itself; curl needs no -X POST with -F):
$ echo "your text" | curl -F 'file=@-' https://sidepiece.party/
Paste URL: https://sidepiece.party/3f9c1a7e2b4d
Raw URL: https://sidepiece.party/raw/3f9c1a7e2b4d
Removal URL: https://sidepiece.party/remove/…
Send a file. Its name is kept, and its extension picks the syntax highlighting:
$ curl -F '[email protected]' https://sidepiece.party/
Add a description, an expiry and comments. Name piped text with ;filename=:
$ curl -F '[email protected]' -F title='Deploy helper' -F expires_in=1hour -F comments=1 https://sidepiece.party/
$ echo '# Notes' | curl -F 'file=@-;filename=notes.md' https://sidepiece.party/
Form fields
| Field | Meaning |
|---|---|
file | a file upload: -F 'file=@name', or @- for standard input. Repeat it for more files. UTF-8 text only |
title | optional description |
language | optional (repeat it, in order, for several files); auto or omitted means "from the filename". Names: /api/languages |
expires_in | optional, one of the values below (default 3day) |
comments | optional, 1 lets visitors comment, 0 doesn't; left out, the site's default applies (and a site can turn comments off entirely) |
Several files in one paste
Repeat file for each file, up to 10 files. The reply has one raw URL per file.
$ curl -F '[email protected]' -F '[email protected]' https://sidepiece.party/
Paste URL: https://sidepiece.party/3f9c1a7e2b4d
Raw URL (main.py): https://sidepiece.party/raw/3f9c1a7e2b4d
Raw URL (README.md): https://sidepiece.party/raw/3f9c1a7e2b4d/README.md
Removal URL: https://sidepiece.party/remove/…
JSON
POST /create with Content-Type: application/json. One file:
{"content": "print(1)\n", "filename": "hello.py", "title": "Hello", "expires_in": "1hour", "comments": false}
Several files:
{"title": "Project", "files": [
{"filename": "main.py", "content": "print(1)\n"},
{"filename": "README.md", "content": "# Hi"}
]}
The answer is JSON; url and removal_url are paths on this site:
{"paste_id": "3f9c1a7e2b4d", "url": "/3f9c1a7e2b4d", "removal_token": "…", "removal_url": "/remove/…"}
$ curl -s -X POST https://sidepiece.party/create -H 'Content-Type: application/json' \
-d '{"content": "hello", "filename": "hi.txt"}'
Reading and removing
GET /<id> | the page (?view=preview shows Markdown files rendered, ?f=2&L=5-12 highlights lines of the second file) |
GET /raw/<id> | the first file as text/plain |
GET /raw/<id>/<filename> | any file of the paste |
GET or POST /remove/<token> | removes the paste at once, no confirmation, so plain curl works (a HEAD request only checks) |
$ curl https://sidepiece.party/raw/3f9c1a7e2b4d
$ curl https://sidepiece.party/remove/<token> # the Removal URL: fetching it removes the paste (POST works too)
Limits
- UTF-8 text only (binary is refused with 415); at most 5.0 MB per paste in total and 10 files.
- 10 pastes per 10 minutes per address.
- Expiry values for
expires_in:1hour(1 hour),1day(1 day),3day(3 days),1week(1 week).
| Status | Meaning |
|---|---|
| 403 | your address is blocked from posting here |
| 400 | nothing to paste, an empty file, or a bad request (the body says which) |
| 413 | paste too large, or more than 10 files |
| 415 | not UTF-8 text |
| 429 | too many requests; wait a few minutes |