Bad-Protect | Dashboard
Bad-Protect
Chargement...
Logo Bad-Protect

Bad-Protect

🔗 Connexion
API v1 — Opérationnelle

API Bad-Protect

Intégrez la réputation inter-serveurs Bad-Protect dans vos bots. Signalez des incidents, synchronisez vos bans et protégez votre communauté.

Base URL

https://bad-protect.fr/api/v1

Routes disponibles

GET https://bad-protect.fr/api/v1/ping 🌐 Public
GET https://bad-protect.fr/api/v1/ 🌐 Public
GET https://bad-protect.fr/api/v1/reputation/:userId reputation:read 🔒 Auth
POST https://bad-protect.fr/api/v1/incident incident:write 🔒 Auth
GET https://bad-protect.fr/api/v1/stats stats:read 🔒 Auth

Limites de taux

120

Par clé / min

300

Global IP / min

429 Too Many Requests

Headers X-RateLimit-Remaining et X-RateLimit-Reset sur chaque réponse.

Niveaux de confiance

NEW Score 0–4
TRUSTED Score 5–19
NEUTRAL Score 20–79
SUSPICIOUS Score 80–199
DANGEROUS Score 200–499
BLACKLISTED Score 500+
GET /ping 🌐 Public

Réponse 200

{
  "status": "ok",
  "version": "v1",
  "timestamp": "2026-03-22T12:00:00.000Z",
  "message": "Bad-Protect API opérationnelle"
}
GET /reputation/:userId 🔒 Auth

Scope requis : reputation:read

Paramètres

Champ Type Requis Description
userId string Oui ID Discord (17-20 chiffres)

Exemple Node.js

const res = await fetch('https://bad-protect.fr/api/v1/reputation/123456789012345678', {
  headers: { 'x-api-key': 'bp_live_votre_cle' }
});
const data = await res.json();
console.log(data.reputation.trust_level); // "SUSPICIOUS"

Réponse 200

{
  "source": "db",
  "reputation": {
    "user_id": "123456789012345678",
    "username": null,
    "global_score": 95,
    "trust_level": "SUSPICIOUS",
    "total_reports": 3,
    "total_warns": 2,
    "total_kicks": 1,
    "total_bans": 0
  },
  "active_bans": [],
  "recent_incidents": [...]
}
POST /incident 🔒 Auth

Scope requis : incident:write

Paramètres

Champ Type Requis Description
user_id string Oui ID Discord de l'utilisateur
incident_type string Oui SPAM, RAID, TOXIC, SCAM, THREAT, NSFW, IMPERSONATION, OTHER
action_taken string Non NONE, WARN, KICK, BAN (défaut: NONE)
severity number Non 1 à 5 (défaut: 2)
description string Non Description (max 1000 chars)
guild_id string Non ID Discord du serveur source
guild_name string Non Nom du serveur source

Exemple Node.js

const res = await fetch('https://bad-protect.fr/api/v1/incident', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': 'bp_live_votre_cle'
  },
  body: JSON.stringify({
    user_id: '123456789012345678',
    incident_type: 'SPAM',
    action_taken: 'KICK',
    severity: 3,
    guild_id: '987654321098765432'
  })
});

Réponse 200

{
  "success": true,
  "user_id": "123456789012345678",
  "new_score": 45,
  "trust_level": "NEUTRAL",
  "score_added": 30
}
GET /stats 🔒 Auth

Scope requis : stats:read

Réponse 200

{
  "total_users": 15420,
  "avg_score": 12,
  "total_incidents": 8934,
  "last_incident_at": "2026-03-22T12:00:00.000Z",
  "active_global_bans": 234
}

Mesures de sécurité actives

SHA-256

Clés stockées chiffrées

Anti-bruteforce

10 échecs/min → blocage

Rate limit double

Par clé ET par IP

Validation inputs

Sanitisation complète

Scopes

Permissions granulaires

CORS restrictif

Origines autorisées seulement

Sec headers

CSP, X-Frame-Options...

SQL préparé

0 injection SQL possible

Codes d'erreur HTTP

Code Signification Action
200 Succès —
400 Paramètres invalides Vérifiez le body
401 Clé manquante ou invalide Ajoutez x-api-key
403 Clé révoquée ou scope insuffisant Vérifiez vos permissions
404 Route inconnue Vérifiez l'URL
429 Trop de requêtes Attendez X-RateLimit-Reset
500 Erreur interne Contactez le support

Test — Ping

Aucune clé requise. Vérifie que l'API répond.

Test — Réputation utilisateur

Testez /reputation/:userId avec votre clé API.

Besoin d'aide avec le bot ? 👋
Bad-Protect

Support Bad-Protect

Système Opérationnel • En ligne

Besoin d'aide avec le bot ? 👋
Bad-Protect

Support Bad-Protect

Système Opérationnel • En ligne