Ana Sayfa

Api dökümanı

Anonim Paste Servisi api kullanım kılavuzu

Genel Bilgiler

Base URL: https://huseyinboyraz.com.tr/paste/api

Content-Type: application/json

Api Versiyonu: 1.0.0

Api Endpoint'leri

1. Paste Oluşturma

POST /api

Request Body:

{
    "content": "string (required)",
    "title": "string (optional, default: 'paste')",
    "language": "string (optional, default: 'text')",
    "expiration": "string (optional, default: '10m')"
}

Expiration Seçenekleri:

Response (Success):

{
    "success": true,
    "id": "abc123def456ghi789",
    "url": "https://huseyinboyraz.com.tr/paste/abc123def456ghi789",
    "expires_at": 1696094400,
    "expiration_type": "10m"
}

Response (Error):

{
    "error": "Content is required"
}

2. Paste Görüntüleme

GET /api/{id}

Pasteyi html formatında döndürür

Kullanım Örnekleri

JavaScript (Fetch API)

// 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

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"
  }'

Python (requests)

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']}")

Hata Kodları

Desteklenen Programlama Dilleri

Api, 100+ programlama dili ve formatını destekler:

• JavaScript
• Python
• PHP
• Java
• C++
• C#
• Go
• Rust
• Ruby
• Swift
• Kotlin
• TypeScript
• HTML
• CSS
• JSON
• XML
• YAML
• SQL
• Bash
• PowerShell
• Ve daha fazlası