Creates an EnergyLabel instance from a product in EPREL, choosing the label from its productGroup.
EnergyLabel
productGroup
Pass the product as the EPREL public API returns it. Like createEnergyLabel, it bundles all the labels.
createEnergyLabel
The product data from the EPREL API.
An EnergyLabel instance ready to generate the SVG.
If the product group has no label in this library.
const response = await fetch('https://eprel.ec.europa.eu/api/product/1573269')const product = await response.json()const svgString = createEnergyLabelFromEprel(product).toString() Copy
const response = await fetch('https://eprel.ec.europa.eu/api/product/1573269')const product = await response.json()const svgString = createEnergyLabelFromEprel(product).toString()
Creates an
EnergyLabelinstance from a product in EPREL, choosing the label from itsproductGroup.Pass the product as the EPREL public API returns it. Like
createEnergyLabel, it bundles all the labels.