Naar de inhoud
GET /v1/random

A random opening

Probeer het live

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

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

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

Verkrijg een API-sleutel

Codefragmenten

curl "https://api.oanor.com/chessopenings-api/v1/random" \
  -H "x-oanor-key: oanor_test_..."
await fetch("https://api.oanor.com/chessopenings-api/v1/random", {
  headers: { "x-oanor-key": "oanor_test_..." }
});
$ch = curl_init("https://api.oanor.com/chessopenings-api/v1/random");
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/chessopenings-api/v1/random",
    headers={"x-oanor-key": "oanor_test_..."}
)

Voorbeeldrespons

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

{
    "data": {
        "opening": {
            "eco": "E36",
            "pgn": "1. d4 Nf6 2. c4 e6 3. Nc3 Bb4 4. Qc2 d5 5. a3 Bxc3+ 6. Qxc3 Ne4",
            "ply": 12,
            "name": "Nimzo-Indian Defense: Classical Variation, Noa Variation, Main Line",
            "moves": [
                "d4",
                "Nf6",
                "c4",
                "e6",
                "Nc3",
                "Bb4",
                "Qc2",
                "d5",
                "a3",
                "Bxc3+",
                "Qxc3",
                "Ne4"
            ],
            "family": "Nimzo-Indian Defense",
            "volume": "E",
            "variation": "Classical Variation, Noa Variation, Main Line"
        }
    },
    "meta": {
        "timestamp": "2026-05-31T09:34:54.986Z",
        "request_id": "83348a25-604e-42a4-b5f1-b8383f8d219c"
    },
    "status": "ok",
    "message": "Random opening",
    "success": true
}