API
Create and read bins from scripts and tools. An API key is optional. Without one, new bins are anonymous.
https://bin.sirblob.co Authentication
Create a key on the API keys page and send it in the Authorization header. Bins you create with a key show up in your dashboard, and you can read your own private bins.
Authorization: Bearer tb_your_key_here
For password protected bins, send the password in the X-Bin-Password header.
Bins
Create a bin
/api/bins API key optionalCreates a new text bin and returns its share link. Without an API key the bin is anonymous. To share an image, use the upload image endpoint.
JSON body
contentstringRequired The text or code to save. Up to 512 KB.
namestringA title for the bin. Defaults to "Untitled".
languagestringA language id from the list below. Defaults to "txt".
visibilitystring"link" (default, anyone with the link), "password", or "private" (only you, needs an API key).
passwordstringRequired when visibility is "password". At least 4 characters.
expirystringWhen to delete the bin: "never", "10m", "1h", "1d", "1w", "1mo". Defaults to "never". Bins created without an API key are always deleted within 1 week.
burnAfterReadingbooleanDelete the bin the first time someone else opens it.
Example request
curl -X POST https://bin.sirblob.co/api/bins \
-H "Authorization: Bearer $THEBIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"hello","language":"js","content":"console.log('Hello!')"}'Responses
201 The bin was created.
{
"id": "a1b2c3d4e5",
"url": "https://bin.sirblob.co/a1b2c3d4e5",
"rawUrl": "https://bin.sirblob.co/a1b2c3d4e5/raw"
}400 The content is empty, too large, or the language is unknown.
{
"message": "The bin is empty."
}401 The API key is invalid or has been revoked.
{
"message": "The API key is invalid or has been revoked"
}415 The request body is not JSON.
{
"message": "Content-Type must be application/json"
}Get a bin
/api/bins/:id API key optionalReturns a bin and its details as JSON. For image bins, content is null. Send X-Bin-Password for password protected bins, and your API key to read your own private bins.
Path parameters
idstringRequired The 10 character bin id from the share link.
Example request
curl https://bin.sirblob.co/api/bins/a1b2c3d4e5Responses
200 The bin was found.
{
"id": "a1b2c3d4e5",
"name": "hello",
"language": "js",
"sizeBytes": 21,
"visibility": "link",
"expiresAt": null,
"burnAfterReading": false,
"createdAt": "2026-11-27T12:00:00.000Z",
"updatedAt": "2026-11-27T12:00:00.000Z",
"content": "console.log('Hello!')",
"url": "https://bin.sirblob.co/a1b2c3d4e5",
"rawUrl": "https://bin.sirblob.co/a1b2c3d4e5/raw"
}401 The bin is password protected and the password is missing or wrong.
{
"message": "Send the bin password in the X-Bin-Password header"
}404 No bin has this id, or it is private.
{
"message": "Bin not found"
}Get raw content
/:id/raw Returns the plain text of a bin, or the image file for image bins. Handy for piping into other tools.
Path parameters
idstringRequired The 10 character bin id from the share link.
Example request
curl https://bin.sirblob.co/a1b2c3d4e5/rawResponses
200 The content as text/plain, or the image with its own content type.
404 No bin has this id.
Images
Upload an image
/api/images API key optionalCreates a new image bin. Send the image file as the request body with its image Content-Type. PNG, JPEG, GIF and WebP are accepted.
Query parameters
namequery stringA title for the image, passed as ?name=. Defaults to "Untitled".
visibility, expiryquery stringThe same sharing options as for text bins, passed as ?visibility= and ?expiry=. Send a password in the X-Bin-Password header.
Request body
bodybinaryRequired The raw image file, up to the size limit set by the site admin.
Example request
curl -X POST "https://bin.sirblob.co/api/images?name=screenshot" \
-H "Content-Type: image/png" \
--data-binary @screenshot.pngResponses
201 The image was uploaded.
{
"id": "a1b2c3d4e5",
"mimeType": "image/png",
"sizeBytes": 48213,
"url": "https://bin.sirblob.co/a1b2c3d4e5",
"rawUrl": "https://bin.sirblob.co/a1b2c3d4e5/raw"
}400 The file is empty or is not a PNG, JPEG, GIF or WebP image.
{
"message": "Only PNG, JPEG, GIF and WebP images are allowed."
}413 The image is larger than the size limit.
{
"message": "The image is too large. The limit is 2.0 MB."
}Download an image
/api/images/:id API key optionalReturns the image file of an image bin with its original content type.
Path parameters
idstringRequired The 10 character bin id from the share link.
Example request
curl -o image.png https://bin.sirblob.co/api/images/a1b2c3d4e5Responses
200 The image file.
404 No image bin has this id. Text bins return 404 here.
{
"message": "Image not found"
}Your bins
List your bins
/api/bins API key requiredReturns the bins that belong to your API key, newest first by default. Expired bins are left out.
Query parameters
qquery stringOnly bins whose name contains this text.
languagequery stringOnly bins with this language id, or "img" for images.
sortquery string"newest", "oldest", "name", "largest" or "views".
limitquery stringHow many bins to return, up to 100. Defaults to 50.
offsetquery stringHow many bins to skip, for paging.
Example request
curl -H "Authorization: Bearer $THEBIN_API_KEY" \
"https://bin.sirblob.co/api/bins?sort=views&limit=10"Responses
200 Your bins. hasMore is true when another page may follow.
{
"bins": [
{
"id": "a1b2c3d4e5",
"name": "hello",
"language": "js",
"sizeBytes": 21,
"visibility": "link",
"expiresAt": null,
"burnAfterReading": false,
"viewCount": 12,
"lastViewedAt": "2026-11-27T13:00:00.000Z",
"createdAt": "2026-11-27T12:00:00.000Z",
"updatedAt": "2026-11-27T12:00:00.000Z",
"url": "https://bin.sirblob.co/a1b2c3d4e5",
"rawUrl": "https://bin.sirblob.co/a1b2c3d4e5/raw"
}
],
"limit": 10,
"offset": 0,
"hasMore": false
}401 The API key is missing, invalid or revoked.
{
"message": "Send a valid API key in the Authorization header"
}Update a bin
/api/bins/:id API key requiredChanges one of your bins. Send only the fields you want to change. Image bins can change their name and sharing options.
Path parameters
idstringRequired The 10 character bin id from the share link.
JSON body
namestringA new title.
contentstringNew text content. Text bins only.
languagestringA new language id. Text bins only.
visibilitystring"link" (default, anyone with the link), "password", or "private" (only you, needs an API key).
passwordstringA new password. Leave it out to keep the current one.
expirystringA new expiry, counted from now. Leave it out to keep the current one.
Example request
curl -X PATCH https://bin.sirblob.co/api/bins/a1b2c3d4e5 \
-H "Authorization: Bearer $THEBIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "hello v2", "expiry": "1w"}'Responses
200 The updated bin.
{
"id": "a1b2c3d4e5",
"name": "hello v2",
"language": "js",
"sizeBytes": 21,
"visibility": "link",
"expiresAt": null,
"burnAfterReading": false,
"viewCount": 12,
"lastViewedAt": "2026-11-27T13:00:00.000Z",
"createdAt": "2026-11-27T12:00:00.000Z",
"updatedAt": "2026-11-27T12:00:00.000Z",
"url": "https://bin.sirblob.co/a1b2c3d4e5",
"rawUrl": "https://bin.sirblob.co/a1b2c3d4e5/raw",
"content": "console.log('Hello!')"
}400 A value is invalid.
{
"message": "Unknown or unsupported language"
}401 The API key is missing, invalid or revoked.
{
"message": "Send a valid API key in the Authorization header"
}404 No bin with this id belongs to you.
{
"message": "Bin not found"
}Delete a bin
/api/bins/:id API key requiredDeletes one of your bins for good, including its image.
Path parameters
idstringRequired The 10 character bin id from the share link.
Example request
curl -X DELETE -H "Authorization: Bearer $THEBIN_API_KEY" \
https://bin.sirblob.co/api/bins/a1b2c3d4e5Responses
204 The bin was deleted. There is no body.
401 The API key is missing, invalid or revoked.
{
"message": "Send a valid API key in the Authorization header"
}404 No bin with this id belongs to you.
{
"message": "Bin not found"
}Replace an image
/api/images/:id API key requiredSwaps the image in one of your image bins. The link stays the same. Send the file the same way as when uploading.
Path parameters
idstringRequired The 10 character bin id from the share link.
Request body
bodybinaryRequired The new image file with its image Content-Type.
Example request
curl -X PUT https://bin.sirblob.co/api/images/a1b2c3d4e5 \
-H "Authorization: Bearer $THEBIN_API_KEY" \
-H "Content-Type: image/png" \
--data-binary @new-screenshot.pngResponses
200 The image was replaced.
{
"id": "a1b2c3d4e5",
"mimeType": "image/png",
"sizeBytes": 51022,
"url": "https://bin.sirblob.co/a1b2c3d4e5",
"rawUrl": "https://bin.sirblob.co/a1b2c3d4e5/raw"
}400 The file is not a supported image, or the bin is a text bin.
{
"message": "Only PNG, JPEG, GIF and WebP images are allowed."
}401 The API key is missing, invalid or revoked.
{
"message": "Send a valid API key in the Authorization header"
}404 No bin with this id belongs to you.
{
"message": "Bin not found"
}Copy a bin
/api/bins/:id/copy API key optionalMakes a new text bin with the same content as any bin you can open. With an API key the copy belongs to you. The body is optional.
Path parameters
idstringRequired The 10 character bin id from the share link.
JSON body
namestringA title for the copy. Defaults to "Copy of ...".
visibilitystring"link" (default, anyone with the link), "password", or "private" (only you, needs an API key).
passwordstringRequired when visibility is "password". At least 4 characters.
expirystringWhen to delete the bin: "never", "10m", "1h", "1d", "1w", "1mo". Defaults to "never". Bins created without an API key are always deleted within 1 week.
Example request
curl -X POST -H "Authorization: Bearer $THEBIN_API_KEY" \
https://bin.sirblob.co/api/bins/a1b2c3d4e5/copyResponses
201 The copy was created.
{
"id": "f6g7h8i9j0",
"url": "https://bin.sirblob.co/f6g7h8i9j0",
"rawUrl": "https://bin.sirblob.co/f6g7h8i9j0/raw"
}400 Image bins and bins that burn after reading cannot be copied.
{
"message": "Image bins cannot be copied"
}404 No bin has this id, or you cannot open it.
{
"message": "Bin not found"
}Info
Your account
/api/me API key requiredShows who an API key belongs to and their usage. A quick way to check that a key works.
Example request
curl -H "Authorization: Bearer $THEBIN_API_KEY" https://bin.sirblob.co/api/meResponses
200 The account and its stats.
{
"id": "665f1c2e9b1d4a0012345678",
"name": "Alex",
"email": "[email protected]",
"role": "user",
"stats": {
"binCount": 42,
"textCount": 37,
"imageCount": 5,
"totalBytes": 1843200,
"imageBytes": 1720320,
"recentCount": 6,
"firstCreatedAt": "2026-01-04T09:30:00.000Z",
"lastCreatedAt": "2026-11-27T12:00:00.000Z",
"languages": [
{
"language": "js",
"count": 14
}
]
}
}401 The API key is missing, invalid or revoked.
{
"message": "Send a valid API key in the Authorization header"
}List languages
/api/languages Every language id you can use for a text bin, with its display name.
Example request
curl https://bin.sirblob.co/api/languagesResponses
200 The supported languages.
{
"languages": [
{
"id": "txt",
"label": "Text"
},
{
"id": "js",
"label": "JavaScript"
}
]
}Get limits
/api/limits The current size limits, rate limit and expiry choices, so tools can check before uploading.
Example request
curl https://bin.sirblob.co/api/limitsResponses
200 The limits. Sizes are in bytes and times in seconds.
{
"maxContentBytes": 524288,
"maxImageBytes": 2097152,
"maxNameLength": 100,
"minBinPasswordLength": 4,
"allowedImageTypes": [
"image/png",
"image/jpeg",
"image/gif",
"image/webp"
],
"createRequestsPerMinute": 20,
"anonymousBinLifetimeSeconds": 604800,
"expiryChoices": [
{
"id": "1h",
"label": "1 hour",
"seconds": 3600
}
]
}Errors
Errors come back as JSON with a message field when the request
sends Accept: application/json.
- 400 The request is missing something or has an invalid value.
- 401 The API key or bin password is missing or wrong.
- 404 The bin does not exist, has expired, or is private.
- 413 The uploaded image is larger than the size limit.
- 415 The Content-Type is wrong. Bins need application/json, images need an image type.
- 429 Too many requests. You can create, copy or change up to 20 bins and images per minute.
- 507 The site has run out of storage space.
Limits
- Up to 20 new bins and images per minute from each address
- Text content up to 512 KB per bin
- Images up to 2.0 MB, as PNG, JPEG, GIF or WebP
Languages
Use one of these ids for the language field.
txt Texthtml HTMLcss CSSjs JavaScriptts TypeScriptjsx JSXtsx TSXjava Javakt Kotlingroovy Groovyscala Scalacs C#php PHPpy Pythonrb Rubyperl Perllua Luar Rjulia Juliac Ccpp C++objc Objective-Cgo Gorust Rustswift Swiftdart Darths Haskellclj Clojuresh Shellps1 PowerShellsass Sassless Lessmd Markdowntex LaTeXtyp Typstjson JSONyaml YAMLtoml TOMLini INIxml XMLsql SQLgraphql GraphQLproto Protobufdocker Dockerfilenginx Nginxcmake CMakediff Diffvue Vuesvelte Svelteang Angular