>_$ ./<YasirBin{0x1337}/> API
Official REST API documentation and CLI integration guide for YasirBin.
🚀 API Usage
You can create a new document by sending a POST request to the /api/document endpoint. The API accepts both application/x-www-form-urlencoded (form-data) and application/json content types.
Using Form Data
The following examples use the `curl` command to create pastes with form data.
Basic Paste
curl -X POST -d "content=Hello from form-data" https://bin.yasirweb.eu.org/api/document
With Password
curl -X POST -d "content=This is a secret paste" -d "password=supersecret" https://bin.yasirweb.eu.org/api/document
With Expiration
You can set `expires` to `1d`, `7d`, or `30d`.
curl -X POST -d "content=This will expire in 1 day" -d "expires=1d" https://bin.yasirweb.eu.org/api/document
With Password and Expiration
curl -X POST -d "content=Secret expiring paste" -d "password=supersecret" -d "expires=7d" https://bin.yasirweb.eu.org/api/document
Using JSON
The following examples use the `curl` command to create pastes with JSON data.
Basic Paste
curl -X POST -H "Content-Type: application/json" -d '{"content":"Hello from JSON"}' https://bin.yasirweb.eu.org/api/document
With Password
curl -X POST -H "Content-Type: application/json" -d '{"content":"This is a secret paste","password":"supersecret"}' https://bin.yasirweb.eu.org/api/document
With Expiration
curl -X POST -H "Content-Type: application/json" -d '{"content":"This will expire in 1 day","expires":"1d"}' https://bin.yasirweb.eu.org/api/document
With Password and Expiration
curl -X POST -H "Content-Type: application/json" -d '{"content":"Secret expiring paste","password":"supersecret","expires":"7d"}' https://bin.yasirweb.eu.org/api/document
From a File
This is the recommended method for uploading files.
Basic Upload
curl -X POST --data-urlencode "content@Dockerfile" https://bin.yasirweb.eu.org/api/document
With Password and Expiration
curl -X POST --data-urlencode "content@Dockerfile" -d "password=supersecret" -d "expires=7d" https://bin.yasirweb.eu.org/api/document
Example Response
A successful request will return the following JSON response:
{
"ok": true,
"message": "succesfully created document",
"data": {
"url": "https://bin.yasirweb.eu.org/some-random-slug",
"length": 123,
"date": "2026-09-16T12:10:00Z",
"expire_at": "2026-10-16T12:10:00Z"
}
}
Get a Document
To retrieve a document's content, you can use the `/api/document` endpoint with the document's slug as the `key` query parameter.
curl "https://bin.yasirweb.eu.org/api/document?key=<your-document-slug>"
Get Raw Content
To get the raw content of a paste for piping or redirection.
Public Paste
curl https://bin.yasirweb.eu.org/raw/some-random-slug
Password-Protected Paste
curl "https://bin.yasirweb.eu.org/raw/some-random-slug?password=supersecret"