Skip to main content
After your customer has connected their energy tariff in your app, you can retrieve their energy prices. You can then display them to the customer, plan energy consumption (or exports), and generate accurate cost reports.

Getting the data

The retrieve-price endpoint allows your system to access energy price for a specified time window. It works in the following way:
  1. Intakes time period for which the price is required
  2. Returns price as non-fixed, time-series dataset
curl --request POST \
  --url https://api.flatpeak.com/prices/loc_65e42ce4d3b813479b252160 \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "start_time": "2023-06-15T09:00:00Z",
  "end_time": "2023-06-15T23:00:00Z",
  "tariff_direction": "IMPORT"
}'

Units, Precision & Rounding

  • All monetary values are returned in major currency units
  • Values may have up to 5 decimal places, i.e. 0.12345

Accuracy and forecasts

Flatpeak retrieves price data from a constellation of sources, including direct connections energy providers, market data, proprietary tariff libraries, and other systems. Depending on how frequently tariff updates are published by each source, data for the period you request may not yet be available. When this happens, Flatpeak automatically forecasts the price using a range of algorithms selected based on the structure and source of the underlying tariff.
  • Forecasted data is returned with a confidence < 1 flag.
  • Once the actual price becomes available, Flatpeak replaces the forecast with the confirmed data and sets confidence = 1.
Learn more in the Price Forecasts guide.

Data update strategy

Get price
  1. Use data fetched for future periods for planning only.
  2. For best accuracy, request data only as far into the future as your system requires.
  3. Subscribe to location.update events via webhooks and re-fetch price when it updates.
  4. When you need to calculate energy cost, use Cost Calculation APIs.

Handling Timezones and Daylight Saving Time (DST)

See the Timezones & DST guide for best practices on handling timezones and daylight saving in your integration.