Ir al contenido
GET /v1/difficulty

Encounter difficulty

Pruébalo en vivo

10 llamadas gratis al día — sin registro, sin clave API. Pasa por el gateway de oanor.

Encabezados personalizados (opcional)
api.oanor.com/dndencounter-api

Funciona. Consigue una clave API y úsala en tu proyecto.

Obtener una clave API

Fragmentos de código

curl "https://api.oanor.com/dndencounter-api/v1/difficulty" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/dndencounter-api/v1/difficulty", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/dndencounter-api/v1/difficulty");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
import requests
requests.get(
    "https://api.oanor.com/dndencounter-api/v1/difficulty",
    headers={"x-oanor-key": "oanor_test_..."}
)

Respuesta de ejemplo

Una respuesta real de este endpoint, capturada en la última comprobación de estado.

{
    "data": {
        "note": "Adjusted XP = total monster XP × the count multiplier (1.5 for two, 2 for 3–6, up to 4 for 15+). Compare to the party thresholds for the difficulty. XP for the reward is the unadjusted total.",
        "inputs": {
            "levels": [
                5,
                5,
                5,
                5
            ],
            "party_size": 4,
            "monster_count": 4
        },
        "difficulty": "hard",
        "multiplier": 2,
        "adjusted_xp": 3600,
        "xp_thresholds": {
            "easy": 1000,
            "hard": 3000,
            "deadly": 4400,
            "medium": 2000
        },
        "total_monster_xp": 1800
    },
    "meta": {
        "timestamp": "2026-06-06T07:14:07.795Z",
        "request_id": "6251dd74-f20a-41f1-8300-4d02ce3fa685"
    },
    "status": "ok",
    "message": "Encounter difficulty",
    "success": true
}