🔐 Aegis Nexus API

Güvenli URL kontrol sistemini entegre et

📍 Base URL: https://api.aegisnexus.dev/api/v1
GET
✅ Health Check
/health

API'nin çalışıp çalışmadığını kontrol et.

Response:
{ "status": "healthy", "timestamp": "2026-04-16T14:00:00Z", "version": "1.0" }
GET
🔍 Tek URL Kontrolü
/check-url?url=<domain>

Belirtilen URL'nin güvenliğini kontrol et.

Parametreler:
Parametre Tür Durum Açıklama
url string Gerekli Kontrol edilecek domain veya URL
Response:
{ "url": "https://google.com", "score": 100, "risk_level": "✅ Güvenli", "timestamp": "2026-04-16T14:00:00Z" }
POST
📋 Toplu Tarama
/bulk-scan

CSV dosyası yükleyerek birden fazla URL'yi tara.

Form Data:
Field Tür Durum Açıklama
file file Gerekli CSV dosyası (bir URL per satır)
Response:
{ "total": 4, "processed": 4, "safe": 2, "critical": 2, "results": [ { "url": "https://google.com", "score": 100, "risk_level": "✅ Güvenli" } ] }
GET
🛡️ Whitelist Listesi
/whitelist?category=<category>&limit=50

Güvenilen domainleri görüntüle.

Parametreler:
Parametre Tür Durum Açıklama
category string Opsiyonel Kategori filtresi
limit integer Opsiyonel Sonuç limiti (default: 50)
GET
📊 İstatistikler
/stats

Sistem istatistiklerini al.

Response:
{ "whitelist_domains": 232, "categories": { "Tech Companies": 12, "Finance": 14 }, "last_update": "2026-04-16T14:00:00Z" }

💻 Entegrasyon Örnekleri

🔗 JavaScript / Fetch
async function checkUrl(url) { const res = await fetch( `https://api.aegisnexus.dev/api/v1/check-url?url=${encodeURIComponent(url)}` ); const data = await res.json(); return data; }
⚛️ React Hook
function URLChecker() { const [url, setUrl] = useState(''); const [result, setResult] = useState(null); const check = async () => { const res = await fetch( `/api/v1/check-url?url=${encodeURIComponent(url)}` ); const data = await res.json(); setResult(data); }; return ( <> <input onChange={e => setUrl(e.target.value)} /> <button onClick={check}>Check</button> </> ); }
🔌 cURL
curl "https://api.aegisnexus.dev/api/v1/check-url?url=google.com" \ -H "Accept: application/json"
🐍 Python
import requests url = "https://api.aegisnexus.dev/api/v1" response = requests.get( f"{url}/check-url?url=google.com" ) data = response.json() print(data['score'])

⚠️ Hata Yönetimi

HTTP Status Kodları
Kod Açıklama
200 ✅ Başarılı istek
400 ❌ Bad Request (geçersiz parametre)
429 ⏱️ Too Many Requests (rate limit aşıldı)
500 ⚠️ Server Error
Error Response Example:
{ "error": "Invalid URL", "message": "URL formatting error", "timestamp": "2026-04-16T14:00:00Z" }
Try-Catch Örneği
try { const res = await fetch(url); if (!res.ok) { if (res.status === 429) { throw new Error('Rate limit exceeded'); } throw new Error(`HTTP ${res.status}`); } return await res.json(); } catch (error) { console.error(error); }

⏱️ Rate Limiting & Limitler

📊 Rate Limit: 60 requests/minute per IP
Rate Limit Headers
Header Açıklama
X-RateLimit-Limit Toplam limit
X-RateLimit-Remaining Kalan request sayısı
X-RateLimit-Reset Sıfırlanma zamanı (Unix timestamp)
Retry Mantığı
async function checkWithRetry(url, retries = 3) { for (let i = 0; i < retries; i++) { const res = await fetch( `/api/v1/check-url?url=${encodeURIComponent(url)}` ); if (res.status === 429) { await new Promise(r => setTimeout(r, 2000) ); continue; } return await res.json(); } throw new Error('Max retries exceeded'); }

🧪 Etkileşimli Test

🔍 URL Testa
📊 İstatistikler
✅ Health Check