Skip to main content
In this guide, you will connect an energy account using Flatpeak Connect and retrieve the electricity price.
If you have not yet done so, create a Dashboard account and contact support to activate your 30-day free trial.
1

Authenticate to API

  1. Go to the Dashboard > API Keys and retrieve your Account ID and API Key.
Flatpeak Dashboard API Keys
  1. Base64 encode account_id:api_key and call authentication endpoint.
  curl --request GET \
  --url https://api.flatpeak.com/login \
  --header 'Authorization: Basic <base64 encoded account_id:api_key>'
2

Create a Connect token

Connect tokens are single-use session keys that let your app launch Flatpeak Connect securely without exposing API keys.To create a Connect token, call create-connect-token endpoint:
curl --request POST \
--url https://api.flatpeak.com/connect/token \
--header 'Authorization: Bearer <bearer_token>' \
--header 'Content-Type: application/json' \
--data '{
  "connect_url": "https://anode.connect-web.flatpeak.com",
  "callback_url": "myapp://nova/flatpeak/complete",
  "postal_address": {
    "address_line1": "1-3",
    "address_line2": "Strand",
    "city": "London",
    "state": "Greater London",
    "post_code": "WC2N 5EH",
    "country_code": "GB"
  }
}'
3

Launch the Connect web app

The Flatpeak-hosted demo of the Connect app is available at:https://anode.connect-web.flatpeak.comAppend your connect_token to the URL as shown below:
https://anode.connect-web.flatpeak.com/?fp_cot=cot_6587fa4362341be5b524de3b
4

Complete the Connect flow

The Connect app guides you through selecting your energy provider and granting tariff access. It automatically chooses the best connection method based on available integrations, market coverage, and data-sharing rules.
To test Connect quickly, use your own account from any supported energy provider. If you don’t have access to one, contact support for a test account.
5

Retrieve Flatpeak Location ID

After completing the Connect flow, call the retrieve-connect-token endpoint with your connect_token to obtain a Flatpeak Location ID — a permanent identifier for the customer’s address.When you build your full integration, store this ID in your database as the reference to the customer’s address. You will use it to retrieve electricity prices and access other API endpoints.For now, just make a note of it.
curl --request GET \
--url 'https://api.flatpeak.com/connect/token?connect_token=cot_6587fa4362341be5b524de3b' \
--header 'Authorization: Bearer <token>'
6

Get electricity prices

Using the Location ID as a reference, call the retrieve-price endpoint to retrieve your customer’s electricity price.
curl --request POST \
  --url https://api.flatpeak.com/prices/loc_641b90b758fb8e6293716e40 \
  --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"
}'
You’ve now completed the Quickstart. If you haven’t already, review integration plan options.
Before you continue, invite your team members to join your Flatpeak account. Go to Dashboard > Settings > Team, and add their emails. They’ll receive an automatic invitation.