Real-time chess opening identification and transition analysis based on move sequences.
/api/openings/matchIdentifies chess openings and transitions that match the provided move sequence.
moveHistory// Example move sequence: 1.e4 e5 2.Nf3 Nc6 3.Bb5
const moves = ["e4", "e5", "Nf3", "Nc6", "Bb5"];
const response = await fetch(`/api/openings/match?moveHistory=${encodeURIComponent(JSON.stringify(moves))}`);{
"exactMatches": true,
"count": 3,
"openings": [
{
"id": "string",
"fen": "string",
"eco": "C60",
"moves": "1. e4 e5 2. Nf3 Nc6 3. Bb5",
"name": "Ruy Lopez",
"src": "string",
"isEcoRoot": true,
"aliases": [
{
"source": "string",
"value": "Spanish Opening"
}
]
}
],
"transitions": [
{
"id": "string",
"fromFen": "string",
"toFen": "string",
"fromSrc": "string",
"toSrc": "string",
"fromOpening": {
"id": "string",
"fen": "string",
"eco": "C60",
"name": "Ruy Lopez",
"moves": "string"
},
"toOpening": {
"id": "string",
"fen": "string",
"eco": "C65",
"name": "Ruy Lopez, Berlin Defense",
"moves": "string"
}
}
],
"searchInfo": {
"normalizedMoves": "1. e4 e5 2. Nf3 Nc6 3. Bb5",
"movesCount": 5,
"moves": ["e4", "e5", "Nf3", "Nc6", "Bb5"]
}
}{
"error": "El parámetro moveHistory es requerido"
}{
"error": "Formato inválido para moveHistory. Debe ser un array JSON"
}["e4", "e5", "Nf3", "Nc6", "Bb5"]["e4", "e5", "Nf3", "Nc6", "Bb5"]"1. e4 e5 2. Nf3 Nc6 3. Bb5"fromSrc or toSrc fields