Getting tariff rates
FlatPeak tariff-rates API endpoint returns live tariff rates by location_id
.
Various tariff types and formats accessible as time-series via FlatPeak tariff rates API
Why FlatPeak uses time-series format in tariff rates
To enable you to access any tariff currently offered on the planet via a single API, including complex time of use, consumption tier and dynamic market-based tariffs, FlatPeak had to design a data model that can universally support both static and dynamic tariff types.
Using tariff rates API
Follow the steps below to get data from the tariff rates API endpoint:
Run Connect flow
If you have not done so already, run the Connect flow and make a note of the location_id
.
Call tariff rates API endpoint
Using location_id
as reference call tariff-rates endpoint.
Tariff data units, precision and rounding
FlatPeak works with large currency units across all interfaces and API endpoints. It will always return tariff data with the maximum precision available, today this may mean 4 or even 5 fractional digits i.e. (EUR) 0.12345
.
We recommend that you implement rounding in your user interfaces. You can use this Connect-web example as reference.
How often tariff data is refreshed
Every tariff rates API response includes the next_update
key that indicates when tariff information may be refreshed from its source. For example, when market rates are published or when FlatPeak systems are scheduled to pull tariff updates from your customers’ account with their energy provider.
We recommend you always rely on data in the next_update
key to get your systems to pull updated rates. If you are unable to create a dynamic schedule, you can presume that tomorrow’s rates will be updated by 23.00 local time the day earlier.
Calculating energy cost
Because FlatPeak provides this data in time-series format, you will need to call this endpoint for every period you need tariff data for. You can request a maximum of one month’s worth of data per call.
While using the tariff rates endpoint provides you with maximum flexibility in storing and using tariff data, we recommend you consider using Cost Calculation endpoints which you may find much quicker to implement.
Was this page helpful?