User API Routes

This document describes api for MyBroodMinder users - currently in beta.

Send request for use to support@broodminder.com

Authentication

All endpoints require a rate-limited API key in the request header.

Header:

X-Api-Key: <your-api-key>

The key is associated to a single user account, only requests to that account's data are authorized.

Common query parameters

Parameter Required Type Description
start yes integer Unix epoch timestamp in seconds for the start of the time window
end yes integer Unix epoch timestamp in seconds for the end of the time window

Endpoints

GET /user/metadata/apiaries

Returns the list of apiaries for the authenticated user.

Success response

[
  {
    "apiaryId": "apiary-123",
    "name": "Main Apiary",
    "color": "blue",
    "hives": [
      {
        "hiveId": "hive-456",
        "name": "Hive A",
        "description": "North field hive",
        "color": "yellow"
      }
    ],
    "location": {
      "latitude": 44.123456,
      "longitude": -93.123456
    }
  }
]

Notes


GET /user/hive/{id}/readings

Returns sensor readings grouped by position for a hive owned by the authenticated user. Limited to 6 months of data per request.

Success response

[
  {
    "positionID": "position-1",
    "positionName": "Front",
    "readings": [
      {
        "deviceId": "device-123",
        "timestamp": 1684128000,
        "batteryLevel": 93,
        "chargeRemaining": 110,
        "readings": {
          "temperature": 34.8,
          "humidity": 60.2
        }
      }
    ]
  }
]

Notes


GET /user/hive/{id}/notes

Returns notes attached to a hive for the authenticated user. Limited to 6 months of data per request.

Success response

{
  "notes": [
    {
      "id": "note-123",
      "hiveId": "hive-456",
      "description": "Checked hive entrance.",
      "tags": [
        { "id": "tag-1", "name": "inspection" }
      ],
      "timestamp": 1684128000,
      "created": 1684128000,
      "modified": 1684129000
    }
  ]
}

Notes


GET /user/device/{id}/readings

Returns sensor readings for a single device belonging to the authenticated user. Limited to 6 months of data per request.

Success response

[
  {
    "deviceId": "device-123",
    "timestamp": 1684128000,
    "batteryLevel": 95,
    "chargeRemaining": 120,
    "readings": {
      "temperature": 35.2,
      "humidity": 61.4,
      "weight": 25.76,
      "radar": 0,
      "audio": 0,
      "swarmState": 0
    }
  }
]

Notes


Common error responses

Example request

GET /user/device/abc123/readings?start=1684128000&end=1684214400 HTTP/1.1
Host: external-api.mybroodminder.com
X-Api-Key: YOUR_API_KEY

Recommended Usage Strategy