Parce que chaque heure compte

📊 API des prix de l'électricité en France

Cette API vous donne accès en temps réel aux prix de l'électricité en France sur le marché day-ahead EPEX SPOT. Données fiables, mise à jour quotidienne, accès simple et rapide.

💡 Cas d'usage

NOUVEAU 🔧 Personnaliser mon prix

Calculez automatiquement votre prix final HT/TTC par kWh en ajoutant simplement quelques paramètres à vos requêtes existantes. L'API intègre le TURPE, l'accise électricité et la TVA selon votre profil.

⚡ Comment ça marche ?

Ajoutez les paramètres segment et turpe à vos requêtes sur les routes /api/prices/tomorrow et /api/prices/raw. La réponse sera automatiquement enrichie avec les prix HT (et TTC pour C5) par kWh.

📝 Paramètres de tarification

Paramètre Type Requis Description
segment String optionnel Segment tarifaire du compteur.
Valeurs possibles :
C5 - BT ≤ 36 kVA (défaut)
C4 - BT > 36 kVA
⚠️ Pour C4 : profil forcé à "pro" et display forcé à "HT"
turpe String optionnel Option TURPE pour le calcul du prix final.
Valeurs C5 : CU | CU4 | MU4 | MUDT | LU
Valeurs C4 : CU | LU
profil String optionnel Profil client pour l'accise électricité (C5 uniquement).
Valeurs possibles :
pro - Professionnel (accise: 25,79 €/MWh)
particulier - Particulier (accise: 29,98 €/MWh)
Par défaut: particulier. Ignoré pour C4 (forcé à pro).
display String optionnel Mode d'affichage (C5 uniquement).
Valeurs possibles : HT | TTC
Par défaut: TTC. Ignoré pour C4 (forcé à HT).

📏 Unités utilisées

  • spot_price : Prix spot brut en €/MWh (valeur originale EPEX SPOT)
  • Tous les autres prix : Exprimés en €/kWh (spot converti, TURPE, Accise, HT, TTC)

📐 Formule de calcul

Conversion spot : spot_price_eur_kwh = spot_price / 1000

Prix HT (€/kWh) = spot_price_eur_kwh + turpe_eur_kwh + accise_eur_kwh

Prix TTC (€/kWh) = price_ht_eur_kwh × (1 + 20%)

Composantes :spot_price_eur_kwh : prix spot converti (€/MWh → €/kWh)
  • turpe_eur_kwh : TURPE selon option et plage horaire
  • accise_eur_kwh : accise selon profil (pro/particulier)

Plages horaires :
  • HP (Heures Pleines) : 6h - 22h
  • HC (Heures Creuses) : 22h - 6h

Saisons :
  • H (Haute) : novembre à mars
  • B (Basse) : avril à octobre

📊 Table TURPE C5 - BT ≤ 36 kVA (c€/kWh)

Option HPH HCH HPB HCB
CU 4,84 4,84 4,84 4,84
CU4 7,49 3,97 1,66 1,16
MUDT 4,94 3,50 4,94 3,50
MU4 7,00 3,73 1,61 1,11
LU 1,25 1,25 1,25 1,25

📊 Table TURPE C4 - BT > 36 kVA (c€/kWh)

Option HPH HCH HPB HCB
CU - Courte Utilisation 6,91 4,21 2,13 1,52
LU - Longue Utilisation 5,69 3,47 2,01 1,49

💡 Bon à savoir

  • Rétrocompatibilité : Sans les paramètres turpe/segment, la réponse reste identique à l'actuelle
  • Segment C5 (défaut) : Prix HT ou TTC selon display, profil pro ou particulier
  • Segment C4 : Prix HT uniquement, profil pro automatique (accise 25,79 €/MWh)
  • Détail complet : Chaque point inclut spot_price_eur_kwh, turpe_eur_kwh, accise_eur_kwh, price_ht_eur_kwh
  • Métadonnées : Un bloc pricing_metadata détaille les paramètres, formules et unités utilisés
🔓 Route publique - Sans authentification
URL de base :
https://api.sobry.co

📋 Informations importantes

GET /api/prices/tomorrow

Récupère les prix day-ahead pour demain avec des statistiques automatiques (min, max, moyenne, médiane). Idéal pour avoir un aperçu rapide des prix à venir.

📝 Paramètres optionnels (tarification)

Paramètre Type Requis Description
segment String optionnel Segment: C5 (défaut) | C4
turpe String optionnel C5: CU | CU4 | MU4 | MUDT | LU
C4: CU | LU
profil String optionnel C5: pro | particulier (défaut). C4: forcé à pro
display String optionnel C5: HT | TTC (défaut). C4: forcé à HT

📊 Exemples de requête

# Requête basique (prix spot uniquement)
curl https://api.sobry.co/api/prices/tomorrow

# C5 - Avec calcul prix TTC (particulier, TURPE CU4)
curl "https://api.sobry.co/api/prices/tomorrow?turpe=CU4&profil=particulier"

# C4 - Prix HT automatique (pro, TURPE LU)
curl "https://api.sobry.co/api/prices/tomorrow?segment=C4&turpe=LU"
// Requête basique
const response = await fetch('https://api.sobry.co/api/prices/tomorrow');
const data = await response.json();
console.log(data.statistics);

// Avec calcul prix HT/TTC
const params = new URLSearchParams({
  turpe: 'CU4',
  profil: 'particulier'
});
const response2 = await fetch(`https://api.sobry.co/api/prices/tomorrow?${params}`);
const data2 = await response2.json();
console.log(data2.pricing_metadata);
console.log(data2.prices[0].price_ttc_eur_kwh);
import requests

# Requête basique
response = requests.get('https://api.sobry.co/api/prices/tomorrow')
data = response.json()
print(data['statistics'])

# Avec calcul prix HT/TTC
params = {
    'turpe': 'CU4',
    'profil': 'particulier'
}
response2 = requests.get(
    'https://api.sobry.co/api/prices/tomorrow',
    params=params
)
data2 = response2.json()
print(f"Prix TTC: {data2['prices'][0]['price_ttc_eur_kwh']} €/kWh")

✅ Réponse basique (200 OK)

200 OK application/json - Sans paramètres de tarification
{
  "success": true,
  "date": "2025-10-24",
  "timezone": "Europe/Paris (CET)",
  "count": 24,
  "statistics": {
    "min": 42.50,
    "max": 98.30,
    "average": 65.20,
    "median": 63.10
  },
  "prices": [
    {
      "timestamp": "2025-10-24T00:00:00+02:00",
      "spot_price": 45.32
    },
    {
      "timestamp": "2025-10-24T01:00:00+02:00",
      "spot_price": 43.10
    }
    // ... 24 heures au total
  ]
}

✅ Réponse enrichie (200 OK) - Avec turpe & profil (display=TTC)

200 OK application/json - Avec ?turpe=CU4&profil=particulier
{
  "success": true,
  "date": "2025-10-24",
  "timezone": "Europe/Paris (CET)",
  "count": 24,
  "statistics": {
    "min": 42.50,
    "max": 98.30,
    "average": 65.20,
    "median": 63.10
  },
  "pricing_metadata": {
    "enabled": true,
    "turpe_option": "CU4",
    "profil": "particulier",
    "display": "TTC",
    "tva_rate": 0.20,
    "accise_eur_kwh": 0.02998,
    "turpe_source": "table interne Sobry (c€/kWh → €/kWh)",
    "formula_ht": "spot_price_eur_kwh + turpe_eur_kwh + accise_eur_kwh",
    "formula_ttc": "price_ht_eur_kwh × (1 + TVA 20%)",
    "units": {
      "spot_price": "€/MWh",
      "all_other_prices": "€/kWh"
    }
  },
  "prices": [
    {
      "timestamp": "2025-10-24T00:00:00+02:00",
      "spot_price": 45.32,              // €/MWh (valeur brute)
      "spot_price_eur_kwh": 0.04532,   // €/kWh (converti)
      "turpe_eur_kwh": 0.0397,          // €/kWh (HCB saison basse)
      "accise_eur_kwh": 0.02998,        // €/kWh (particulier)
      "price_ht_eur_kwh": 0.115,        // €/kWh (total HT)
      "price_ttc_eur_kwh": 0.138       // €/kWh (total TTC)
    },
    {
      "timestamp": "2025-10-24T10:00:00+02:00",
      "spot_price": 85.50,
      "spot_price_eur_kwh": 0.0855,
      "turpe_eur_kwh": 0.0166,          // €/kWh (HPB heures pleines)
      "accise_eur_kwh": 0.02998,
      "price_ht_eur_kwh": 0.13208,
      "price_ttc_eur_kwh": 0.1585
    }
    // ... 24 heures au total
  ]
}

✅ Réponse enrichie (200 OK) - Avec display=HT

200 OK application/json - Avec ?turpe=CU4&profil=pro&display=HT
{
  "success": true,
  ...
  "pricing_metadata": {
    "enabled": true,
    "turpe_option": "CU4",
    "profil": "pro",
    "display": "HT",
    "tva_rate": null,                  // pas de TVA en mode HT
    "accise_eur_kwh": 0.02579,         // accise pro
    ...
  },
  "prices": [
    {
      "timestamp": "2025-10-24T00:00:00+02:00",
      "spot_price": 45.32,
      "spot_price_eur_kwh": 0.04532,
      "turpe_eur_kwh": 0.0397,
      "accise_eur_kwh": 0.02579,
      "price_ht_eur_kwh": 0.11081     // pas de TTC en mode HT
    }
  ]
}
🧪 Essayer maintenant 🧪 Essayer avec TTC 🧪 Essayer avec HT
GET /api/prices/raw

Récupère les prix bruts entre deux dates. Idéal pour récupérer des données historiques ou construire vos propres analyses. Granularité personnalisable.

📝 Paramètres

Paramètre Type Requis Description
start String REQUIS Date de début au format YYYY-MM-DD (exemple: 2025-10-23)
end String REQUIS Date de fin au format YYYY-MM-DD (exemple: 2025-10-24)
granularity String optionnel Granularité des données (défaut: quarter_hourly)
Valeurs possibles :
quarter_hourly - Données toutes les 15 minutes
hourly - Données horaires
daily - Données journalières
timezone String optionnel Timezone IANA (défaut: CET). Exemple: CET, UTC, Europe/Paris
country String optionnel Code pays ISO (défaut: FR pour France)
provider String optionnel Fournisseur de données (défaut: epex)

📝 Paramètres optionnels (tarification)

Paramètre Type Requis Description
segment String optionnel Segment: C5 (défaut) | C4
turpe String optionnel C5: CU | CU4 | MU4 | MUDT | LU
C4: CU | LU
profil String optionnel C5: pro | particulier (défaut). C4: forcé à pro
display String optionnel C5: HT | TTC (défaut). C4: forcé à HT

📊 Exemples de requête

# Requête basique (granularité par défaut: quarter_hourly)
curl "https://api.sobry.co/api/prices/raw?start=2025-10-23&end=2025-10-24"

# Avec granularité horaire
curl "https://api.sobry.co/api/prices/raw?start=2025-10-23&end=2025-10-24&granularity=hourly"

# C5 - Avec calcul prix TTC (particulier, TURPE CU4)
curl "https://api.sobry.co/api/prices/raw?start=2025-10-23&end=2025-10-24&turpe=CU4&profil=particulier"

# C4 - Prix HT automatique (pro, TURPE CU)
curl "https://api.sobry.co/api/prices/raw?start=2025-10-23&end=2025-10-24&segment=C4&turpe=CU"
// Requête basique
const params = new URLSearchParams({
  start: '2025-10-23',
  end: '2025-10-24'
});

const response = await fetch(`https://api.sobry.co/api/prices/raw?${params}`);
const data = await response.json();
console.log(data.data);

// Avec calcul prix HT/TTC
const params2 = new URLSearchParams({
  start: '2025-10-23',
  end: '2025-10-24',
  turpe: 'CU4',
  profil: 'particulier'
});

const response2 = await fetch(`https://api.sobry.co/api/prices/raw?${params2}`);
const data2 = await response2.json();
console.log(data2.pricing_metadata);
console.log(data2.data[0].price_ttc_eur_kwh);
import requests

# Requête basique
params = {
    'start': '2025-10-23',
    'end': '2025-10-24'
}

response = requests.get(
    'https://api.sobry.co/api/prices/raw',
    params=params
)
data = response.json()
print(f"Nombre de prix: {data['count']}")

# Avec calcul prix HT/TTC
params2 = {
    'start': '2025-10-23',
    'end': '2025-10-24',
    'turpe': 'CU4',
    'profil': 'particulier'
}

response2 = requests.get(
    'https://api.sobry.co/api/prices/raw',
    params=params2
)
data2 = response2.json()
print(f"Prix TTC: {data2['data'][0]['price_ttc_eur_kwh']} €/kWh")

✅ Réponse basique (200 OK)

200 OK application/json - Sans paramètres de tarification
{
  "success": true,
  "params": {
    "start": "2025-10-23",
    "end": "2025-10-24",
    "country": "FR",
    "granularity": "quarter_hourly",
    "provider": "epex",
    "timezone": "CET"
  },
  "count": 96,
  "data": [
    {
      "timestamp": "2025-10-23T00:00:00+02:00",
      "spot_price": 52.30
    },
    {
      "timestamp": "2025-10-23T00:15:00+02:00",
      "spot_price": 51.80
    },
    {
      "timestamp": "2025-10-23T00:30:00+02:00",
      "spot_price": 50.95
    }
    // ... tous les prix pour la période (96 points par jour en quarter_hourly)
  ]
}

✅ Réponse enrichie (200 OK) - Avec turpe & profil (display=TTC)

200 OK application/json - Avec ?turpe=CU4&profil=particulier
{
  "success": true,
  "params": {
    "start": "2025-10-23",
    "end": "2025-10-24",
    "country": "FR",
    "granularity": "quarter_hourly",
    "provider": "epex",
    "timezone": "CET"
  },
  "pricing_metadata": {
    "enabled": true,
    "turpe_option": "CU4",
    "profil": "particulier",
    "display": "TTC",
    "tva_rate": 0.20,
    "accise_eur_kwh": 0.02998,
    "turpe_source": "table interne Sobry (c€/kWh → €/kWh)",
    "formula_ht": "spot_price_eur_kwh + turpe_eur_kwh + accise_eur_kwh",
    "formula_ttc": "price_ht_eur_kwh × (1 + TVA 20%)",
    "units": {
      "spot_price": "€/MWh",
      "all_other_prices": "€/kWh"
    }
  },
  "count": 96,
  "data": [
    {
      "timestamp": "2025-10-23T00:00:00+02:00",
      "spot_price": 52.30,              // €/MWh (valeur brute)
      "spot_price_eur_kwh": 0.0523,    // €/kWh (converti)
      "turpe_eur_kwh": 0.0397,          // €/kWh (HCB)
      "accise_eur_kwh": 0.02998,        // €/kWh
      "price_ht_eur_kwh": 0.12198,      // €/kWh (total HT)
      "price_ttc_eur_kwh": 0.14638     // €/kWh (total TTC)
    },
    {
      "timestamp": "2025-10-23T10:00:00+02:00",
      "spot_price": 75.40,
      "spot_price_eur_kwh": 0.0754,
      "turpe_eur_kwh": 0.0166,          // €/kWh (HPB heures pleines)
      "accise_eur_kwh": 0.02998,
      "price_ht_eur_kwh": 0.12198,
      "price_ttc_eur_kwh": 0.14638
    }
    // ... tous les prix pour la période avec détail complet
  ]
}
🧪 Essayer maintenant 🧪 Essayer avec TTC 🧪 Essayer avec HT

⚠️ Codes d'erreur