API REST pour les données du tennis de table belge
H | Hainaut |
Li | Liège |
N | Namur |
Lu | Luxembourg |
W | Brabant Wallon |
A | Antwerpen |
E | Oost-Vlaanderen |
O | West-Vlaanderen |
L | Limburg |
V | Vlaams-Brabant |
K | Brussels |
Du plus bas au plus haut :
PRE | Pré-minimes (-9 ans) |
MIN | Minimes (9-10 ans) |
CAD | Cadets (11-12 ans) |
JUN | Juniors (13-14 ans) |
SEN | Seniors (21-39 ans) |
V40 | Vétérans 40+ |
V50 | Vétérans 50+ |
V60 | Vétérans 60+ |
V | Victoire |
D | Défaite |
WO | Walk-over (forfait) |
GET /health
Réponse :
{ "status": "ok" }
GET /api/stats
Réponse :
{
"clubs": 823,
"players": 45210,
"matches": 156420,
"players_with_matches": 12500
}
| Param | Type | Description |
|---|---|---|
province | string | Filtrer par province (ex: Hainaut) |
limit | int | Nombre max de résultats |
offset | int | Pagination |
GET /api/clubs
GET /api/clubs?province=Hainaut
GET /api/clubs?limit=50&offset=0
Réponse :
{
"count": 156,
"clubs": [
{ "code": "H004", "name": "ETT MANAGE", "province": "Hainaut" },
{ "code": "H005", "name": "CTT GODARVILLE", "province": "Hainaut" }
]
}
GET /api/clubs/provinces
Réponse :
{
"provinces": ["Antwerpen", "Brabant Wallon", "Hainaut", "Liège", "Limburg", ...]
}
GET /api/clubs/H004
Réponse :
{
"code": "H004",
"name": "ETT MANAGE",
"province": "Hainaut",
"address": "Rue de la Salle 12",
"city": "Manage"
}
GET /api/clubs/H004/players
Réponse :
{
"club": { "code": "H004", "name": "ETT MANAGE" },
"count": 52,
"players": [
{
"licence": "176506",
"name": "DEBESSEL CHRISTOPHER",
"ranking": "C2",
"points_current": 1285,
"category": "SEN"
}
]
}
POST /api/clubs/H004/scrape
Réponse :
{
"success": true,
"club_code": "H004",
"total_players": 52,
"players_scraped": 52,
"message": "Scraping terminé: 52 joueurs, 52 fiches"
}
⚠️ Cette requête peut prendre 30-60 secondes
| Param | Type | Description |
|---|---|---|
club_code | string | Filtrer par club (ex: H004) |
ranking | string | Filtrer par classement (ex: B2) |
min_points | float | Points minimum |
max_points | float | Points maximum |
search | string | Recherche par nom/licence |
limit | int | Max résultats (1-1000) |
GET /api/players?club_code=H004
GET /api/players?ranking=B2
GET /api/players?min_points=1000&max_points=1500
GET /api/players?search=DEBESSEL
GET /api/players/176506
Réponse :
{
"licence": "176506",
"name": "DEBESSEL CHRISTOPHER",
"club_code": "H004",
"ranking": "C2",
"points_start": 1200,
"points_current": 1285,
"total_wins": 25,
"total_losses": 12,
"stats_masculine": [
{ "opponent_ranking": "C4", "wins": 8, "losses": 2 }
],
"matches_masculine": [
{
"date": "2024-12-10",
"opponent_name": "MARTIN PIERRE",
"opponent_ranking": "C4",
"result": "V",
"score": "3-1"
}
]
}
| Param | Description |
|---|---|
fiche_type | "masculine" ou "feminine" |
opponent | Licence de l'adversaire |
GET /api/players/176506/matches
GET /api/players/176506/matches?fiche_type=masculine
GET /api/players/176506/matches?opponent=152478
GET /api/players/176506/vs/152478
Réponse :
{
"player1": { "licence": "176506", "name": "DEBESSEL CHRISTOPHER" },
"player2": { "licence": "152478", "name": "MARTIN PIERRE" },
"player1_wins": 5,
"player2_wins": 2,
"matches": [...]
}
| Param | Description |
|---|---|
limit | Nombre de joueurs (1-500) |
province | Filtrer par province |
club_code | Filtrer par club |
ranking | Filtrer par classement |
GET /api/rankings/top?limit=100
GET /api/rankings/top?province=Hainaut&limit=50
GET /api/rankings/top?club_code=H004
GET /api/rankings/progressions?limit=50
| Param | Description |
|---|---|
q | Terme de recherche (min 2 caractères) |
limit | Max résultats (1-200) |
GET /api/search?q=DEBESSEL
GET /api/search?q=176506
GET /api/search?q=DEB&limit=20
Réponse :
{
"query": "DEBESSEL",
"count": 2,
"players": [
{ "licence": "176506", "name": "DEBESSEL CHRISTOPHER", "ranking": "C2" }
]
}
const API = window.location.origin;
// Stats
const stats = await fetch(`${API}/api/stats`).then(r => r.json());
// Clubs du Hainaut
const clubs = await fetch(`${API}/api/clubs?province=Hainaut`).then(r => r.json());
// Joueurs d'un club
const players = await fetch(`${API}/api/clubs/H004/players`).then(r => r.json());
// Recherche
const results = await fetch(`${API}/api/search?q=DEBESSEL`).then(r => r.json());
// Fiche joueur
const player = await fetch(`${API}/api/players/176506`).then(r => r.json());
import requests
API = 'https://lkkkwcg88c04c4g8kgw884ko.chris-ia.com'
# Stats
stats = requests.get(f'{API}/api/stats').json()
# Clubs du Hainaut
clubs = requests.get(f'{API}/api/clubs', params={'province': 'Hainaut'}).json()
# Joueurs d'un club
players = requests.get(f'{API}/api/clubs/H004/players').json()
# Recherche
results = requests.get(f'{API}/api/search', params={'q': 'DEBESSEL'}).json()
# Stats
curl https://lkkkwcg88c04c4g8kgw884ko.chris-ia.com/api/stats
# Clubs du Hainaut
curl "https://lkkkwcg88c04c4g8kgw884ko.chris-ia.com/api/clubs?province=Hainaut"
# Scraper un club (POST)
curl -X POST https://lkkkwcg88c04c4g8kgw884ko.chris-ia.com/api/clubs/H004/scrape