Base URL: https://huseyinboyraz.com.tr/paste/api
Content-Type: application/json
Api Versiyonu: 1.0.0
POST /api
{
"content": "string (required)",
"title": "string (optional, default: 'paste')",
"language": "string (optional, default: 'text')",
"expiration": "string (optional, default: '10m')"
}
10m - 10 Dakika30m - 30 Dakika1h - 1 Saat6h - 6 Saat12h - 12 Saat1d - 1 Gün7d - 7 Gün1M - 1 Ay1y - 1 Yılnever - Asla{
"success": true,
"id": "abc123def456ghi789",
"url": "https://huseyinboyraz.com.tr/paste/abc123def456ghi789",
"expires_at": 1696094400,
"expiration_type": "10m"
}
{
"error": "Content is required"
}
GET /paste/{id} veya /api/{id}
Pasteyi Prism.js sözdizimi vurgulama, satır numaraları ve hata bildirim kutusuyla birlikte HTML formatında döndürür.
GET /paste/raw/{id} veya /api/raw/{id}
Paste içeriğini hiçbir HTML etiketi olmadan saf düz metin (text/plain; charset=utf-8) formatında döndürür. Scriptler, curl, wget ve otomasyonlar için idealdir.
curl -sL https://huseyinboyraz.com.tr/paste/raw/abc123def456ghi789
curl -sL https://huseyinboyraz.com.tr/paste/raw/abc123def456ghi789 | bash
Paste görüntülenirken belirli bir satırdaki hataya dikkat çekmek ve doğrudan o satıra odaklanmak için URL parametreleri veya satır numaralarına tıklama kullanılabilir:
?error={satir_no} - Belirtilen satırı kırmızı hata animasyonu ve sol kenarlıkla vurgular, sayfa açıldığında otomatik olarak o satıra kaydırır. Örnek: https://huseyinboyraz.com.tr/paste/abc123def456ghi789?error=14// Paste oluştur
const response = await fetch('https://huseyinboyraz.com.tr/paste/api', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
content: 'console.log("Hello World!");',
title: 'My JavaScript Code',
language: 'javascript',
expiration: '1d'
})
});
const data = await response.json();
console.log('Paste URL:', data.url);
curl -X POST https://huseyinboyraz.com.tr/paste/api \
-H "Content-Type: application/json" \
-d '{
"content": "print(\"Hello World!\")",
"title": "Python Code",
"language": "python",
"expiration": "1h"
}'
import requests
url = "https://huseyinboyraz.com.tr/paste/api"
data = {
"content": "print('Hello World!')",
"title": "Python Script",
"language": "python",
"expiration": "1d"
}
response = requests.post(url, json=data)
result = response.json()
print(f"Paste URL: {result['url']}")
Api, 100+ programlama dili ve formatını destekler: