Authentication

A key is optional. How to get one, and how to send it.

A key is optional. Without one every endpoint still answers, at 30 requests per minute per IP address (Use without a key). A key is free and raises the limit to 240 requests per minute.

Get a key

To get a key:

  1. Request one with the key request form.
  2. An email brings your personal link to the grid map.
  3. Open the link. The key is shown on the welcome card, and at any time in the API tab of the map's right panel.

The same key works for every endpoint of this API. Keep it secret: it identifies you, and the rate limit counts per key. GET /me returns the owner of a key, which confirms the key works before you script anything.

Send the key

Send the key in the X-API-Key header, or as the api_key query parameter. The examples in these guides use this setup:

export KEY="<your key>"
export API="https://grid.rebase.energy/api/v1"
import requests

API = "https://grid.rebase.energy/api/v1"
HEADERS = {"X-API-Key": "<your key>"}

A request with a key that is not valid returns 401 unauthorized; a request with no key at all is answered under the open limit (GET /me alone needs a key). Each key may make 240 requests per minute; see Limits.

To try a call from the API Reference, enter the key in the playground of the endpoint.

On this page