Skip to main content
GET
/
battery
/
{deviceId}
Get battery state
curl --request GET \
  --url https://api.example.com/battery/{deviceId} \
  --header 'x-api-key: <api-key>'
{
  "id": "<string>",
  "vendor": "<string>",
  "sync": {
    "available": true,
    "lastPulledAt": "<string>"
  },
  "metadata": {
    "model": "<string>",
    "source": "cache",
    "cacheType": "expedite"
  },
  "state": {
    "status": "charging",
    "capacity": 123,
    "level": 50,
    "chargeRate": 123,
    "dischargeLimit": 123
  },
  "features": {
    "pull": [
      {
        "key": "<string>",
        "min": 123,
        "max": 123
      }
    ],
    "push": [
      {
        "key": "<string>",
        "min": 123,
        "max": 123
      }
    ]
  }
}

Authorizations

x-api-key
string
header
required

Path Parameters

deviceId
string
required

The unique identifier for the battery device

Example:

"device_abc123"

Query Parameters

expedite
boolean

Use expedite cache with 1 minute TTL instead of normal 15 minute TTL

Example:

false

Response

Battery state retrieved successfully

id
string
required
vendor
string
required
sync
object
required
metadata
object
required
state
object
required
features
object
required