Connect to the API#

Before you can access data with the Energy API you first need to set up authentication. The API uses access tokens to verify a user. A bearer token is generated by submitting a POST request containing your StormGeo portal login credentials in the request’s body, to the login endpoint. The access token is a required field for requests made to all other endpoints.

Important

The access token will be valid for 60 minutes from when you submit a login request.

Authentication#

The following post request will return an access token.

POST /api/v1/auth

Request a bearer token to access the API.

Note: You should replace username and password with your stromgeo username and password.

Content-Type:

application/json

form:
{
  "username": "string",
  "password": "string"
}

Example Request

curl --location --request POST 'https://energy-api.stormgeo.com/api/v1/auth' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "username": "<your-username>",
  "password": "<your-password>"
  }'

Example Response

"bearer_token"