Intégrez les prix en temps réel de Leroy Merlin, Castorama, Brico Dépôt, ManoMano et Monsieur Bricolage directement dans vos logiciels, ERPs et plateformes de devis.
// npm install axios const axios = require('axios'); const API_KEY = 'sk_live_votre_cle_ici'; const BASE = 'https://materioscan.fr/api/v1'; const client = axios.create({ baseURL: BASE, headers: { 'X-API-Key': API_KEY } }); // ── Récupérer les alertes urgentes ──────────────────── async function getUrgentAlerts() { const { data } = await client.get('/alerts', { params: { type: 'GAP', limit: 10 } }); return data.data.filter(a => a.severity === 'high'); } // ── Meilleur prix pour l'isolation ──────────────────── async function getBestInsulationPrice() { const { data } = await client.get('/prices', { params: { category: 'isolation' } }); return data.data .filter(p => p.min_price !== null) .sort((a, b) => a.gap_percent - b.gap_percent); } // ── Injecter dans un devis ──────────────────────────── async function enrichDevis(productId, quantite) { const { data } = await client.get(`/prices/${productId}`); const prices = data.history; const bestStore = Object.entries(prices) .filter(([, h]) => h.length > 0) .map(([s, h]) => ({ store: s, price: h.at(-1).price })) .sort((a, b) => a.price - b.price)[0]; return { store: bestStore.store, unitPrice: bestStore.price, total: bestStore.price * quantite }; }
# pip install requests import requests API_KEY = "sk_live_votre_cle_ici" BASE = "https://materioscan.fr/api/v1" HEADERS = {"X-API-Key": API_KEY} def get_best_prices(category=None): """Retourne les prix actuels, triés par écart décroissant.""" params = {} if category: params["category"] = category resp = requests.get(f"{BASE}/prices", headers=HEADERS, params=params) resp.raise_for_status() data = resp.json()["data"] return sorted( [p for p in data if p["gap_percent"] is not None], key=lambda x: x["gap_percent"], reverse=True ) def get_alerts(alert_type="GAP", limit=20): """Récupère les alertes récentes d'un type donné.""" resp = requests.get( f"{BASE}/alerts", headers=HEADERS, params={"type": alert_type, "limit": limit} ) resp.raise_for_status() return resp.json()["data"] # Exemple : alimenter un DataFrame pandas import pandas as pd prices = get_best_prices("isolation") df = pd.DataFrame(prices) df["savings"] = df["max_price"] - df["min_price"] print(df[["name", "min_price", "best_store", "gap_percent"]].to_string())
# ── Vérifier votre clé et le rate limit ────────────── curl https://materioscan.fr/api/v1/me \ -H "X-API-Key: sk_live_votre_cle_ici" # ── Prix actuels de tous les produits ──────────────── curl "https://materioscan.fr/api/v1/prices" \ -H "X-API-Key: sk_live_votre_cle_ici" \ | jq '.data[] | {nom: .name, meilleur: .min_price, enseigne: .best_store}' # ── Alertes urgentes uniquement ────────────────────── curl "https://materioscan.fr/api/v1/alerts?type=GAP&limit=5" \ -H "X-API-Key: sk_live_votre_cle_ici" # ── Historique 90 jours d'un produit ───────────────── curl "https://materioscan.fr/api/v1/prices/laine-de-verre-100mm?days=90" \ -H "X-API-Key: sk_live_votre_cle_ici" # ── Créer un webhook Discord ────────────────────────── curl -X POST https://materioscan.fr/api/v1/webhooks \ -H "X-API-Key: sk_live_votre_cle_ici" \ -H "Content-Type: application/json" \ -d '{ "url": "https://discord.com/api/webhooks/xxx/yyy", "events": ["alert"] }'
<?php define('MATERIOSCAN_KEY', 'sk_live_votre_cle_ici'); define('MATERIOSCAN_BASE', 'https://materioscan.fr/api/v1'); function materioscan_get($endpoint, $params = []) { $url = MATERIOSCAN_BASE . $endpoint; if (!empty($params)) { $url .= '?' . http_build_query($params); } $ch = curl_init($url); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'X-API-Key: ' . MATERIOSCAN_KEY, 'Accept: application/json' ] ]); $body = curl_exec($ch); curl_close($ch); return json_decode($body, true); } // Meilleur prix isolation pour un devis $prices = materioscan_get('/prices', ['category' => 'isolation']); $best = array_filter($prices['data'], fn($p) => $p['gap_percent'] > 20); foreach ($best as $product) { printf( "%-40s meilleur: %.2f€ chez %s (écart %d%%)\n", $product['name'], $product['min_price'], $product['best_store'], $product['gap_percent'] ); }
────────────────────────────────────────── ZAPIER — Récupérer les alertes GAP ────────────────────────────────────────── Trigger : Schedule — Every 1 hour Action : Webhooks by Zapier → GET URL : https://materioscan.fr/api/v1/alerts Headers : X-API-Key = sk_live_votre_cle Params : type=GAP | limit=5 Filter : Severity = "high" Action : Slack → Send Channel Message Channel : #chantier-alerts Message : 🚨 {{product_name}} — écart {{gap_percent}}% 💰 Économie : {{savings}}€ ────────────────────────────────────────── MAKE (ex-Integromat) — Webhook natif ────────────────────────────────────────── Module 1 : Webhooks → Custom Webhook → Copier l'URL Make générée API Call : POST /api/v1/webhooks { "url": "https://hook.eu1.make.com/xxxyyy", "events": ["alert"] } Module 2 : Router → Branch 1 : severity = "high" → SMS / Push → Branch 2 : severity = "medium" → Email → Branch 3 : type = "DEAL" → Slack Module 3 : Google Sheets → Add Row Colonnes : date | produit | enseigne | prix | économie
// GET /api/v1/prices?category=isolation { "data": [ { "product_id": "laine-de-verre-100mm", "name": "Laine de verre 100mm R=3,15", "category": "isolation", "unit": "m²", "min_price": 8.49, "max_price": 13.20, "gap_percent": 55, "best_store": "bricodepot", "prices": { "leroymerlin": { "price": 13.20, "in_stock": true, "scraped_at": "2026-03-06T08:00:00Z" }, "castorama": { "price": 11.90, "in_stock": true, "scraped_at": "2026-03-06T08:00:00Z" }, "bricodepot": { "price": 8.49, "in_stock": true, "scraped_at": "2026-03-06T08:00:00Z" } } } ], "total": 8, "generated_at": "2026-03-06T13:20:00.000Z" } // GET /api/v1/alerts?type=GAP&limit=1 { "data": [ { "id": 142, "type": "GAP", "product_name": "Laine de verre 100mm", "store": "bricodepot", "title": "Ecart 55% sur Laine de verre 100mm", "savings": 4.71, "severity": "high", "created_at": "2026-03-06T08:05:00Z" } ] }
// Vérifier la signature (Node.js) const sig = 'sha256=' + crypto .createHmac('sha256', WEBHOOK_SECRET) .update(JSON.stringify(payload)) .digest('hex'); if (sig !== req.headers['x-materioscan-signature']) { return res.status(401).end(); } // Relayer vers Discord const { event, data } = payload; await axios.post(DISCORD_WEBHOOK_URL, { content: `🚨 ${data.title} — ${data.savings}€ éco.` });
# Python — récepteur webhook Flask from flask import Flask, request import hmac, hashlib, json app = Flask(__name__) @app.route('/webhook/materioscan', methods=['POST']) def receive_alert(): sig = request.headers.get('X-MaterioScan-Signature') body = request.get_data() expected = 'sha256=' + hmac.new( SECRET.encode(), body, hashlib.sha256 ).hexdigest() if not hmac.compare_digest(sig, expected): return 'Unauthorized', 401 alert = request.json()['data'] # Mettre à jour votre base de données… db.update_price_ref(alert['product_id'], alert['savings']) return 'OK', 200
// Google Apps Script — récepteur webhook function doPost(e) { const payload = JSON.parse(e.postData.contents); const alert = payload.data; const sheet = SpreadsheetApp .getActiveSpreadsheet() .getSheetByName('Alertes'); sheet.appendRow([ new Date(), alert.type, alert.product_name, alert.store, alert.savings + '€', alert.severity ]); return ContentService .createTextOutput('OK'); }
Vous recevrez une clé Developer (100 req/jour) dans les 24h. Aucune carte bancaire requise.
Besoin d'une intégration urgente ou d'un plan Business ? api@materioscan.fr