Search and browse the chess openings database with advanced filtering and sorting options.
/api/openingsRetrieves a paginated list of chess openings with extensive filtering and sorting options.
pagelimitsearchecosortfavoritesOnlyuserId// Get popular openings with pagination
const response = await fetch('/api/openings?page=1&limit=20&sort=popular');
// Search for Sicilian Defense variations
const response = await fetch('/api/openings?search=sicilian&sort=name');
// Filter by ECO code and show user favorites
const response = await fetch('/api/openings?eco=C60&favoritesOnly=true&userId=user123');
// Get all openings sorted by name
const response = await fetch('/api/openings?sort=name&limit=50');{
"openings": [
{
"id": "string",
"fen": "string",
"name": "Ruy Lopez",
"eco": "C60",
"moves": "1. e4 e5 2. Nf3 Nc6 3. Bb5",
"src": "string",
"scid": "string",
"isEcoRoot": true,
"aliases": [
{
"id": "string",
"value": "Spanish Opening",
"source": "string",
"openingId": "string"
}
],
"totalVisits": 150,
"totalFavorites": 25,
"totalPracticeSessions": 75,
"isFavorite": true,
"userVisitCount": 5
}
],
"ecoOptions": ["A00", "A01", "B20", "C60", "D00"],
"pagination": {
"page": 1,
"limit": 20,
"total": 150,
"totalPages": 8,
"hasMore": true
}
}{
"error": "Internal server error"
}popularfavoritesrecentnameeco