Chargement des prompts…
Chargement…
Aucun parcours exécuté pour le moment.
Lancez votre premier parcours ci-dessus !
Vous pouvez lancer un parcours via API et récupérer le résultat (succès/échec, étape d'erreur, produit dans le panier).
POST /api/run — Lancer un parcours synchrone (attend la fin et retourne le résultat)
# Lancer un parcours et attendre le résultat curl -X POST http://localhost:8765/api/run \ -H "Content-Type: application/json" \ -d '{"search_term": "Le Petit Prince"}'
Réponse en cas de succès (HTTP 200) :
{
"success": true,
"run_id": "20260302_143022_a1b2c3",
"search_term": "Le Petit Prince",
"steps_completed": 7,
"total_steps": 7,
"product_in_cart": true,
"product_found": "Le Petit Prince - Poche",
"product_price": "7,50€",
"failed_step": null,
"report_url": "/report/20260302_143022_a1b2c3",
"duration_seconds": 42.5
}
Réponse en cas d'échec (HTTP 422) :
{
"success": false,
"run_id": "20260302_143022_a1b2c3",
"steps_completed": 5,
"total_steps": 7,
"product_in_cart": false,
"failed_step": {
"number": 6,
"title": "Ajout au panier",
"error": "Bouton d'ajout au panier introuvable",
"page_url": "https://example.com/p-...",
"screenshot_url": "/history/.../screenshots/06_add_to_cart.png"
},
"report_url": "/report/20260302_143022_a1b2c3",
"duration_seconds": 28.3
}
POST /api/launch — Lancer un parcours en arrière-plan (retourne immédiatement un run_id)
# Lancement asynchrone curl -X POST http://localhost:8765/api/launch \ -H "Content-Type: application/json" \ -d '{"search_term": "Harry Potter"}' # → {"ok": true, "run_id": "20260302_..."}
GET /api/status/<run_id> — Vérifier le statut d'un parcours en cours
GET /api/history — Liste de tous les parcours exécutés
GET /api/history/<run_id> — Détail d'un parcours (inclut les étapes)
GET /metrics — Prometheus exporter — Métriques du dernier parcours
# Scraper les métriques Prometheus
curl http://localhost:8765/metrics
Réponse (text/plain; version=0.0.4) :
# HELP client_path_success 1 if the last run succeeded # TYPE client_path_success gauge client_path_success{run_id="...",search_term="..."} 1 # HELP client_path_duration_seconds Total duration in seconds # TYPE client_path_duration_seconds gauge client_path_duration_seconds{...} 42.5 # HELP client_path_step_response_time_ms Per-step response time # TYPE client_path_step_response_time_ms gauge client_path_step_response_time_ms{...,step="1",title="Arrivée sur le site"} 8052 client_path_step_response_time_ms{...,step="2",title="Page d'accueil"} 1202 ...
GET /metrics/json — Version JSON classique (rétro-compatibilité)