Hopp til innhold

Getting started

The ecomon API is found on api.ecomon.no. You can get user info, HAN-reader data, and use the delivery charge API (Nettleie-API) here.

This is a GraphQL API which use a query language to return exactly the data specified in the request.

GraphQL Playground

You can use our GraphQL Playground to test and explore queries.

  1. Open a browser and go to https://api.ecomon.no
  2. Put an access token or API key in the HTTP-header section at the bottom of the Playground like this:
"authorization": "Bearer tok_d2bed5de-XXXX-4692-XXXX-63525e4e80bc"

If you have been in contact with us, you should already have an API key sent to you. If you have a user account, use the Login query with email and password to receive an access token.

  1. Copy the query below and paste it in the Playground:
query {
me {

Run the query and you will get your user ID in return! 🎉

Introduction to queries

The API includes many different queries, mutations, and subscriptions. Below is a short list of some of them.

  • Get live HAN-reader data with
  subscription { realTimeMeasurement (...)}
  • Get historic measurement data from the HAN-reader down to a two second resolution
  query { measurements(...)}
  • Get larger aggregated reports with
  query { reports(...)}
  • Add consumption alerts on HAN-readers with
  mutation { addEstimatedHourlyActiveEnergyLimitWarningAlertSetting(...)}
  • Manage permissions and access to HAN-readers
  • Update and delete existing alerts
  • Manage your users
  • ... and more!

Check out the docs and schemas in https://api.ecomon.no for a complete list of all possible queries.

Going to production

GraphQL is in essence just a HTTP request, but when doing request programmatically one would usually use a client library. Check out this site for a list of all clients.