Skip to content

Loads API

Base path: /core/api/communities/{community_id}/loads

Loads are time-series energy measurement records from smart meters (kWh per interval).

Upload Load Data

curl -X POST https://<host>/core/api/communities/{community_id}/loads \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "meter_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "datetime_timestamp": "2024-01-15T10:00:00",
      "energy_value": 0.452,
      "is_estimated": false
    }
  ]'

This triggers an async Celery task. The response returns immediately with a task ID.

Query Load Data

GET /core/api/communities/{community_id}/loads
  ?start_datetime=2024-01-15T00:00:00
  &end_datetime=2024-01-15T23:59:59
  &granularity=HOURLY
  &meter_ids=id1,id2
Parameter Required Description
start_datetime Yes Start of date range (ISO 8601)
end_datetime Yes End of date range (ISO 8601)
granularity No MIN15, HOURLY, DAILY, WEEKLY, MONTHLY (default: MIN15)
meter_ids No Comma-separated meter IDs to filter

Paginated Query

GET /core/api/communities/{community_id}/loads/pagination
  ?skip=0&limit=100&order_by=datetime_timestamp&order=asc