Skip to Content
Hive
Getting started with the API

API Quickstart

Get a token and question the API in a few steps

This guide uses GET /v1/circuits/stats/count as first authenticated request.

Get your credentials

Generate the API key in Hive under User profile > API Keys. You will receive a clientId and a clientSecret.

Get an access token

curl --request POST \
  --url "https://api.eis.it/auth/api-key/login" \
  --header "Content-Type: application/x-www-form-urlencoded" \
  --data-urlencode "clientId=$EIS_CLIENT_ID" \
  --data-urlencode "clientSecret=$EIS_CLIENT_SECRET"

Read the access_token field in the JSON response.

Send an authenticated request

curl --request GET \
  --url "https://api.eis.it/v1/circuits/stats/count" \
  --header "Authorization: Bearer $EIS_ACCESS_TOKEN" \
  --header "Accept: application/json"

The 200 response contains circuit counts:

{
  "active": 128,
  "ko": 2,
  "delivering": 11
}

JavaScript

const response = await fetch("https://api.eis.it/v1/circuits/stats/count", {
  headers: {
    Accept: "application/json",
    Authorization: `Bearer ${process.env.EIS_ACCESS_TOKEN}`,
  },
});

if (!response.ok) {
  throw new Error(`Hive API: HTTP ${response.status}`);
}

console.log(await response.json());

Python

import os
import requests

response = requests.get(
    "https://api.eis.it/v1/circuits/stats/count",
    headers={
        "Accept": "application/json",
        "Authorization": f"Bearer {os.environ['EIS_ACCESS_TOKEN']}",
    },
    timeout=30,
)
response.raise_for_status()
print(response.json())

For the parameters and answers of other endpoints consult the complete reference.

On this page