Dashboard SafeDomain sudah cukup powerful untuk monitor domain manual. Tapi kalau kamu adalah developer di e-commerce, agency dengan ratusan domain client, atau startup yang punya internal tool — kamu butuh API integration agar monitoring domain bisa di-embed langsung ke sistem internal. Artikel ini panduan praktis: use case, endpoint, auth, code examples, dan webhook setup.
💡 TLDR: SafeDomain API memungkinkan kamu cek status domain TrustPositif + ISP Indonesia via REST endpoint, plus webhook untuk real-time alert ke sistem internal. Cocok untuk integrasi ke admin panel, monitoring dashboard, CI/CD, atau workflow automation.
5 Use Case Integrasi API Domain Monitoring
1. Admin Panel Internal — Tampilkan Status Domain Realtime
Kalau kamu manage agency atau e-commerce multi-brand, embed widget status domain ke dashboard admin internal. Tim ops bisa langsung lihat domain mana yang lagi BLOKIR tanpa buka SafeDomain terpisah.
2. CI/CD Pre-Deploy Check
Sebelum deploy update besar, otomatis cek apakah domain target masih AMAN. Kalau BLOKIR terdeteksi, abort deployment + notify team. Hindari deploy ke domain yang lagi bermasalah.
3. Webhook untuk Slack / Discord / Custom Notification
Default SafeDomain notify via Telegram. Tapi banyak agency pakai Slack atau Discord. Setup webhook → forward event blokir ke channel internal team.
4. Audit Periodik Massal (Cron Job)
Domain investor atau agency dengan portfolio 500+ domain butuh audit periodik. Setup script cron yang hit API daily/weekly → generate laporan otomatis ke spreadsheet atau email.
5. Customer-Facing Status Page
Tampilkan badge "Domain Status: ✓ Operational" di footer website. Auto-update via API call. Trust signal untuk customer.
API Endpoints Overview
SafeDomain expose beberapa endpoint utama untuk integrasi (Pro plan):
/api/v1/check/<domain>
Cek status single domain ke TrustPositif + multi-ISP. Return JSON dengan status per ISP.
/api/v1/bulk-check
Bulk check sampai 25 domain dalam 1 request. Body: array domain. Return JSON dengan status per domain per ISP.
/api/v1/domains
List semua domain yang lagi di-monitor di akun kamu, beserta status terakhir & last check time.
/api/v1/domains
Tambah domain baru ke monitoring. Body: {"domain": "example.id", "interval": 300}
/api/v1/webhooks
Register webhook URL untuk receive event status change. Event types: domain.blocked, domain.restored, domain.error.
Authentication
Semua API endpoint require API key di header. Generate API key di:
Dashboard SafeDomain → Settings → API Keys → Generate New Key
Lalu setiap request include header:
Authorization: Bearer YOUR_API_KEY_HERE
Content-Type: application/json
Tips security:
- Simpan API key di environment variable, jangan hardcode di source code
- Rotate key setiap 90 hari
- Pakai API key beda untuk dev vs production environment
- Restrict IP whitelist kalau memungkinkan
Code Example: Python
Setup wrapper sederhana untuk cek domain via Python:
import requests
import os
API_KEY = os.environ.get("SAFEDOMAIN_API_KEY")
BASE_URL = "https://safedomain.id/api/v1"
def check_domain(domain):
"""Cek status domain ke TrustPositif + ISP Indonesia."""
response = requests.get(
f"{BASE_URL}/check/{domain}",
headers={"Authorization": f"Bearer {API_KEY}"},
timeout=10
)
response.raise_for_status()
return response.json()
# Usage
result = check_domain("shop-saya.id")
print(f"Status: {result['overall']}")
print(f"TrustPositif: {result['trustpositif']}")
for isp in result['isp_results']:
print(f" {isp['isp']}: {isp['status']}")
Code Example: JavaScript (Node.js)
Untuk integrasi dari backend Node.js atau serverless function:
const fetch = require('node-fetch');
const API_KEY = process.env.SAFEDOMAIN_API_KEY;
const BASE_URL = 'https://safedomain.id/api/v1';
async function checkDomain(domain) {
const res = await fetch(`${BASE_URL}/check/${domain}`, {
headers: { 'Authorization': `Bearer ${API_KEY}` }
});
if (!res.ok) throw new Error(`API error: ${res.status}`);
return await res.json();
}
// Usage in async function
(async () => {
const result = await checkDomain('shop-saya.id');
console.log(`Status: ${result.overall}`);
})();
Code Example: cURL (Quick Test)
# Test single domain check
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://safedomain.id/api/v1/check/example.id
# Bulk check
curl -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"domains": ["shop.id", "blog.id", "store.id"]}' \
https://safedomain.id/api/v1/bulk-check
Setup Webhook untuk Real-Time Alert
Webhook lebih efisien dari polling — server SafeDomain push event ke endpoint kamu saat status berubah.
Register Webhook
curl -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-app.com/webhooks/safedomain",
"events": ["domain.blocked", "domain.restored"],
"secret": "your-webhook-secret-for-signature-verification"
}' \
https://safedomain.id/api/v1/webhooks
Webhook Payload Example
{
"event": "domain.blocked",
"timestamp": "2026-05-18T13:30:00+07:00",
"data": {
"domain": "shop.id",
"previous_status": "AMAN",
"current_status": "BLOKIR",
"detected_by": ["Indihome", "Telkomsel"],
"domain_id": "dom_abc123"
},
"signature": "sha256=..."
}
Verifikasi signature untuk security:
import hmac, hashlib
def verify_webhook(payload_body, signature_header, secret):
expected = "sha256=" + hmac.new(
secret.encode(),
payload_body,
hashlib.sha256
).hexdigest()
return hmac.compare_digest(expected, signature_header)
Rate Limiting & Best Practices
API SafeDomain punya rate limit:
- Free plan: 100 request/jam
- Pro plan: 1000 request/jam + webhook
- Agency plan: 10000 request/jam + priority support
Best practices integrasi:
- Pakai webhook untuk real-time, bukan polling — hemat quota + faster response
- Cache hasil 60-300 detik kalau cek domain yang sama berulang dalam waktu pendek
- Implement exponential backoff kalau dapat 429 (rate limited)
- Handle 5xx errors dengan retry max 3x
- Log semua API call untuk debugging
- Use timeout 10-30 detik — jangan biarkan request hang forever
💡 Cost optimization: Untuk monitor 100 domain dengan interval 5 menit = 1200 cek/jam. Lebih efisien pakai built-in monitoring SafeDomain (cek sekali via dashboard, dapat webhook saat ada perubahan) daripada polling sendiri 1200x/jam ke API.
FAQ API Domain Monitoring
/api/v1/domains support query ?page=1&limit=50. Default limit 25./check dan /bulk-check (stateless, on-demand). Tapi untuk monitoring 24/7 dengan history, harus add domain via dashboard atau API POST /domains.Pantau Domain Kamu 24/7
Cek gratis dulu tanpa daftar. Mau notifikasi otomatis pas domain diblokir? Baru aktifkan monitoring.
Cek Domain Gratis →