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
answerstring — Answer in Frenchcitationsarray- array
Items: object
idstringtitlestringurlstringcontent_modified_atstring | nulldata_as_ofstring | 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_atstring
Champs requis : id, title, url, content_modified_at, data_as_of, fetched_at
served_atstringcomputed_withobject- object
simulator_versionstring | nullcatalog_versionstring | null
Champs requis : simulator_version, catalog_version
is_simulation_groundedboolean — True when a real per-profile simulation produced the figures (the question carried a consumption/power/size signal).is_data_groundedboolean — 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_msinteger
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
querystring — The question to answer (in French or English)
Champs requis : query
Réponses
200 — Grounded answer with citations
answerstring — Answer in Frenchcitationsarray- array
Items: object
idstringtitlestringurlstringcontent_modified_atstring | nulldata_as_ofstring | 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_atstring
Champs requis : id, title, url, content_modified_at, data_as_of, fetched_at
served_atstringcomputed_withobject- object
simulator_versionstring | nullcatalog_versionstring | null
Champs requis : simulator_version, catalog_version
is_simulation_groundedboolean — True when a real per-profile simulation produced the figures (the question carried a consumption/power/size signal).is_data_groundedboolean — 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_msinteger
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
segmentstringdsostringannual_kwhnumberkvanumberhp_rationumber | nullpricing_basisstringpricing_method_versionstringpricing_scenarioobject- object
curve_yearintegerhc_scheduleobject — 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_idstringwinter_windowsarray- array
Items: object
start_hnumberend_hnumber
Champs requis : start_h, end_h
summer_windowsarray- array
Items: object
start_hnumberend_hnumber
Champs requis : start_h, end_h
effective_fromstringeffective_tostring | nullsourcestringconfidencenumber
Champs requis : zone_id, winter_windows, summer_windows, effective_from, effective_to, source, confidence
Champs requis : curve_year, hc_schedule
pricing_noticestringflexibilityinteger | nullactivity_classstring | nullreduced_or_exempt_accise_attestedboolean | nullaccise_eur_kwhnumber | null — Null for C4 until activity_class is confirmed, or when the effective attested reduced or exempt rate is unavailable.tva_ratenumbertax_method_versionstringtax_classificationobject- object
accise_normal_classstring | nullclassification_basisstringconfirmation_requiredbooleanactivity_class_confirmation_requiredbooleanattested_regime_rate_requiredbooleanreduced_rate_statusstringwarningsarray- array
Items: object
codestringreasonstring
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_versionstringoffersarray- array
Items: object
supplier_namestringoffer_namestringclass_structurestringprice_evolution_typestringprice_basisstringsubscription_tier_kvanumberfixed_scopestring | nullenergy_price_eur_kwh_htnumber | nullsubscription_eur_year_htnumber | nullestimated_annual_ttcnumber | nullpricing_warningsarray- array
Items: string
risk_bandobject | 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_mwhnumberp50_eur_mwhnumberp90_eur_mwhnumbercvar95_eur_mwhnumberbudget_at_risk_eurnumbervol_usednumbervol_sourcestring
Champs requis : p10_eur_mwh, p50_eur_mwh, p90_eur_mwh, cvar95_eur_mwh, budget_at_risk_eur, vol_used, vol_source
source_kindstringfetched_atstringterms_summarystring | 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_scenarioobject | 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.
statusstringlabelstringlow_eur_year_htnumberhigh_eur_year_htnumberincludesstringexcludesarray- array
Items: string
assumptionsarray- array
Items: string
missingarray- array
Items: string
source_urlstringvalid_fromstring
Champs requis : status, label, low_eur_year_ht, high_eur_year_ht, includes, excludes, assumptions, missing, source_url, valid_from
catalog_metaobject- object
totalintegereligibleintegerexcludedintegerstaleintegerdynamicintegerinvalid_priceintegerunknown_price_evolutionintegerinvalid_nameintegerincompatible_price_basisintegerdso_mismatchintegerunsupported_source_scopeintegerunsupported_subscription_tierintegerunverified_professional_audienceintegerstale_threshold_hoursintegerhas_staleboolean
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
codestringerrorstring
Champs requis : code, error