Naar de inhoud
GET /v1/difficulty

Encounter difficulty

Probeer het live

10 gratis calls per dag — geen registratie, geen API-key. Loopt via de oanor-gateway.

Aangepaste headers (optioneel)
api.oanor.com/dndencounter-api

Het werkt. Haal een API-key op en gebruik hem in je project.

Verkrijg een API-sleutel

Codefragmenten

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_..."}
)

Voorbeeldrespons

Een echte respons van dit endpoint, vastgelegd bij de laatste health check.

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