Documentation API Boncourant

L'API Boncourant est une API REST publique qui fournit des réponses sourcées sur les tarifs d'électricité en France. Toutes les réponses sont au format JSON.

Version OpenAPI
3.1.0
Licence
CC-BY 4.0
Spécification machine
/api/aio/openapi.json

GET /api/aio/answer

Get a grounded answer about French electricity tariffs (question in the query string)

Paramètres de requête

Supply q or its alias query for a private, uncached answer. When both are supplied, q takes precedence. Supply topic=trv-gap alone for a cacheable answer about the fixed public reference household.

q
The question to answer (in French or English)
query
Alias for q when q is absent.
topic
Fixed reference-household TRV and market comparison. Send this as the only parameter. The served_at and latency_ms fields describe the original generation on cache hits.

Réponses

200 — Grounded answer with citations

object
answer string — Answer in French
citations array
array
Items: object
id string
title string
url string
content_modified_at string | null
data_as_of string | null — Date of the data used (ISO date or date-time); for public primary sources (CRE, Médiateur national de l’énergie, Enedis, EEX) the effective or observation day.
fetched_at string

Champs requis : id, title, url, content_modified_at, data_as_of, fetched_at

served_at string
computed_with object
object
simulator_version string | null
catalog_version string | null

Champs requis : simulator_version, catalog_version

is_simulation_grounded boolean — True when a real per-profile simulation produced the figures (the question carried a consumption/power/size signal).
is_data_grounded boolean — True when a profile-less answer is backed by real, dated aggregate market figures (TRV vs cheapest tracked offer) recomputed daily by Boncourant, rather than general knowledge.
latency_ms integer

Champs requis : answer, citations, served_at, computed_with, is_simulation_grounded, is_data_grounded, latency_ms

400 — Invalid request

429 — Rate limited

500 — Generation failed

503 — Public reference catalogue unavailable

POST /api/aio/answer

Get a grounded answer about French electricity tariffs

Corps de la requête

Content-Type: application/jsonRequis

object
query string — The question to answer (in French or English)

Champs requis : query

Réponses

200 — Grounded answer with citations

object
answer string — Answer in French
citations array
array
Items: object
id string
title string
url string
content_modified_at string | null
data_as_of string | null — Date of the data used (ISO date or date-time); for public primary sources (CRE, Médiateur national de l’énergie, Enedis, EEX) the effective or observation day.
fetched_at string

Champs requis : id, title, url, content_modified_at, data_as_of, fetched_at

served_at string
computed_with object
object
simulator_version string | null
catalog_version string | null

Champs requis : simulator_version, catalog_version

is_simulation_grounded boolean — True when a real per-profile simulation produced the figures (the question carried a consumption/power/size signal).
is_data_grounded boolean — True when a profile-less answer is backed by real, dated aggregate market figures (TRV vs cheapest tracked offer) recomputed daily by Boncourant, rather than general knowledge.
latency_ms integer

Champs requis : answer, citations, served_at, computed_with, is_simulation_grounded, is_data_grounded, latency_ms

400 — Invalid request

429 — Rate limited

500 — Generation failed

GET /api/b2b/comparer

Simulate the full TTC bill of professional electricity offers for a business profile

Paramètres de requête

Estimates the full bill for eligible professional offers using a synthetic consumption curve. TTC totals are null when required tax evidence is missing, and risk bands appear when the model supports them. C5 (≤ 36 kVA) uses verified MNE offers. C4 (> 36 to 250 kVA) may also return a conditional public Tarif Jaune reference excluding taxes. Read-only.

segment
Segment de raccordement, C5 par défaut.
annual_kwhRequis
Consommation annuelle en kWh.
kvaRequis
Puissance souscrite en kVA, jusqu’à 36 en C5 et au-delà en C4.
hp_ratio
Part de la consommation en heures pleines, entre 0 et 1.
flexibility
Score de flexibilité, entre 0 et 100.
dso
Identifiant du gestionnaire de réseau, enedis par défaut.
activity_class
Classe d’activité au sens du CIBS, requise pour déterminer le taux normal d’accise en C4.
reduced_or_exempt_accise_attested
Indique si une attestation de taux réduit ou d’exonération s’applique. Si oui, le calcul TTC attend la vérification du taux effectif.

Réponses

200 — Eligible offers with evidence-dependent totals and risk bands, tax status and catalogue coverage

object
segment string
dso string
annual_kwh number
kva number
hp_ratio number | null
pricing_basis string
pricing_method_version string
pricing_scenario object
object
curve_year integer
hc_schedule object — Synthetic off-peak windows for the scenario, without any evidence of the customer’s meter schedule.
object — Synthetic off-peak windows for the scenario, without any evidence of the customer’s meter schedule.
zone_id string
winter_windows array
array
Items: object
start_h number
end_h number

Champs requis : start_h, end_h

summer_windows array
array
Items: object
start_h number
end_h number

Champs requis : start_h, end_h

effective_from string
effective_to string | null
source string
confidence number

Champs requis : zone_id, winter_windows, summer_windows, effective_from, effective_to, source, confidence

Champs requis : curve_year, hc_schedule

pricing_notice string
flexibility integer | null
activity_class string | null
reduced_or_exempt_accise_attested boolean | null
accise_eur_kwh number | null — Null for C4 until activity_class is confirmed, or when the effective attested reduced or exempt rate is unavailable.
tva_rate number
tax_method_version string
tax_classification object
object
accise_normal_class string | null
classification_basis string
confirmation_required boolean
activity_class_confirmation_required boolean
attested_regime_rate_required boolean
reduced_rate_status string
warnings array
array
Items: object
code string
reason string

Champs requis : code, reason

Champs requis : accise_normal_class, classification_basis, confirmation_required, activity_class_confirmation_required, attested_regime_rate_required, reduced_rate_status, warnings

cost_dist_method_version string
offers array
array
Items: object
supplier_name string
offer_name string
class_structure string
price_evolution_type string
price_basis string
subscription_tier_kva number
fixed_scope string | null
energy_price_eur_kwh_ht number | null
subscription_eur_year_ht number | null
estimated_annual_ttc number | null
pricing_warnings array
array
Items: string
risk_band object | null — Null when a full-bill TTC estimate or a supported risk model is unavailable.
object | null — Null when a full-bill TTC estimate or a supported risk model is unavailable.
p10_eur_mwh number
p50_eur_mwh number
p90_eur_mwh number
cvar95_eur_mwh number
budget_at_risk_eur number
vol_used number
vol_source string

Champs requis : p10_eur_mwh, p50_eur_mwh, p90_eur_mwh, cvar95_eur_mwh, budget_at_risk_eur, vol_used, vol_source

source_kind string
fetched_at string
terms_summary string | null

Champs requis : supplier_name, offer_name, class_structure, price_evolution_type, price_basis, subscription_tier_kva, fixed_scope, energy_price_eur_kwh_ht, subscription_eur_year_ht, estimated_annual_ttc, pricing_warnings, risk_band, source_kind, fetched_at, terms_summary

public_trv_scenario object | null — Conditional C4 regulated tariff reference excluding taxes, when the applicable source rows are available.
object | null — Conditional C4 regulated tariff reference excluding taxes, when the applicable source rows are available.
status string
label string
low_eur_year_ht number
high_eur_year_ht number
includes string
excludes array
array
Items: string
assumptions array
array
Items: string
missing array
array
Items: string
source_url string
valid_from string

Champs requis : status, label, low_eur_year_ht, high_eur_year_ht, includes, excludes, assumptions, missing, source_url, valid_from

catalog_meta object
object
total integer
eligible integer
excluded integer
stale integer
dynamic integer
invalid_price integer
unknown_price_evolution integer
invalid_name integer
incompatible_price_basis integer
dso_mismatch integer
unsupported_source_scope integer
unsupported_subscription_tier integer
unverified_professional_audience integer
stale_threshold_hours integer
has_stale boolean

Champs requis : segment, dso, annual_kwh, kva, hp_ratio, pricing_basis, pricing_method_version, pricing_scenario, pricing_notice, flexibility, activity_class, reduced_or_exempt_accise_attested, accise_eur_kwh, tva_rate, tax_method_version, tax_classification, cost_dist_method_version, offers, public_trv_scenario, catalog_meta

400 — Malformed, duplicate, missing, unsupported, or segment-inconsistent query parameter

object
code string
error string

Champs requis : code, error