// Renseignez une clé API ci-dessus pour voir l'exemple
X-Api-Key de chaque requête vers /api/analyze.
POST https://booking.test/api/analyze
Header: X-Api-Key: sk_votre_cle
{
"hotel_name": "Riad Sidi Fatah",
"contract_price": 850,
"currency": "MAD",
"checkin": "2026-07-01",
"checkout": "2026-07-02",
"booking_url": "https://www.booking.com/hotel/ma/..."
// OU
"destination": "Marrakech"
}
── Réponse ──────────────────────────────
{
"verdict": "warning", // excellent|good|warning|danger|critical|no_price
"verdict_label": "⚠️ Marge faible",
"margin_pct": 7.4,
"contract_price": 850,
"booking_price": 918,
"message": "Seulement 7.4% d'écart...",
"actions": [
{ "type": "reduce_commission", "label": "...", "priority": "high" },
{ "type": "package", "label": "...", "priority": "medium" }
]
}
Booking/
├── index.html ← interface admin
├── index.php ← toutes les routes API
├── router.php ← Valet router
├── scraper.js ← scraper Playwright + stealth
└── data/ ← JSON sauvegardés
├── scrape_*.json scrapes manuels
├── analysis_*.json analyses parité
└── api_keys.json clés API agences
── Publiques ──────────────────────────────────────────
GET /api/status → état du service
── Admin (interface locale) ───────────────────────────
POST /api/scrape → scrape manuel
POST /api/search-url → génère URL Booking
GET /api/history → liste scrapes
GET /api/history/:file → détail scrape
DEL /api/history/:file → supprimer scrape
GET /api/analyze/history → liste analyses parité
GET /api/analyze/history/:file → détail analyse
DEL /api/analyze/history/:file → supprimer analyse
GET /api/keys → liste clés API
POST /api/keys → créer clé { name }
DEL /api/keys/:id → révoquer clé
── Ogilio (auth X-Api-Key) ────────────────────────────
POST /api/analyze → analyse parité tarifaire
body: { hotel_name, contract_price, currency,
checkin, checkout, booking_url | destination }
retour: { verdict, verdict_label, margin_pct,
contract_price, booking_price, actions[] }
sr_pri_blocks pour garantir le prix.
Sources de prix par ordre de fiabilité :
# Depuis Documents/Laravel/Booking/ valet link # → http://booking.test valet secure Booking # → https://booking.test # Installer les navigateurs Playwright (une seule fois) node_modules/.bin/playwright-core install chromium