Welcome to the Paster.sh REST API v1. Our API allows you to create and manage pastes programmatically from any application, extension, or script. The API is public and does not require authentication, CSRF tokens, or browser sessions.
POST https://api.paster.sh/v1/create
| Parameter | Type | Required | Description |
|---|---|---|---|
content |
string | Yes | The paste content (max 512KB) |
title |
string | No | Paste title (max 255 chars) |
visibility |
string | No | public, unlisted, or private (default: public) |
syntax |
string | No | Syntax highlighting language (default: plain) |
expiration |
string | No | never, 10min, 1hour, 1day, 1week (default: never) |
plain, javascript, python, html, css, bash, php, sql, json, xml, markdown, java, c, cpp, csharp, ruby, go, rust, typescript
curl -X POST https://api.paster.sh/v1/create \
-H "Content-Type: application/json" \
-d '{
"content": "Hello World from API",
"title": "My API Paste",
"syntax": "python",
"visibility": "public"
}'
{
"success": true,
"code": "abc123",
"url": "https://paster.sh/abc123",
"raw": "https://api.paster.sh/v1/raw/abc123"
}
GET https://api.paster.sh/v1/raw/SHORT_CODE
Retrieve the raw content of a paste directly:
curl https://api.paster.sh/v1/raw/abc123
| HTTP Code | Error Message | Reason |
|---|---|---|
| 400 | Content is required | The content field is empty or missing |
| 403 | HTTPS is required | Request made over insecure HTTP |
| 413 | Paste exceeds maximum size | Content exceeds 512KB |
| 429 | Too many requests | Rate limit exceeded (5 requests per minute) |
Cookie or Referer headers; they are ignored.