Getting Started

Follow these steps to get started building your application using Derapi’s API. Use our SDKs for even faster integration.

Get credentials

If you don’t have your Derapi client_id and client_secret please visit https://derapi.com/get-started/ to sign up for a Derapi account.

Credential Types - The Derapi API can be used in two modes, Virtual and Production. Virtual mode credentials can be created using the link above and allow getting started using our API with Virtual Devices. To control real DERs please contact us (support@derapi.com) to request Production credentials.

Authenticate to Derapi

Derapi uses OAuth2 client_id and client_secret for authentication. Our authentication endpoint is https://auth.derapi.com/oauth2/token. Derapi access tokens expire after 1 hour. If your access token expires you should repeat the same process to obtain a new access token.

To acquire a bearer token:

$ curl -u client_id:client_secret \
       -d "grant_type=client_credentials" \
       -X POST https://auth.derapi.com/oauth2/token

The endpoint will respond with JSON similar to the following:

{
  "access_token": "eyJraWQiOiJTd2d0NEFiUCsxNnVTaFJDdnR5aVdGUnpHRlNVd3dcL2xLbUU5",
  "expires_in": 3600,
  "token_type": "Bearer",
  "expires_at": 1723843415.017463
}

Derapi IDs URLs and IDs

The Derapi API structure access to DERs via URLs that reference the specific resource. Objects such as sites, inverters, and batteries each have a unique URL associated with that resource's unique identifier.

  • The URL structure is generally: Derapi Base URL + ID
  • The resource ID also indicates resource type: site, batt, solr
  • For example: https://api.derapi.com/batteries/batt-3e754i27ugnhqbfv

Next steps

You can get started with the Derapi API right away by using our virtual mode, or read up on authorization for real devices.