sondahub

sondahub / Fleet API / Sites

Fake sites API

40 sites from the Fleet API, a fake IoT API. A place devices are installed.

Reads with filters, sorting, search and relations; writes that answer like a real server and stay in your session token. Same ids on every build. Free, no key, CORS open.

Connect

List
https://api.sondahub.com/v1/fleet/sites
One record
https://api.sondahub.com/v1/fleet/sites/{id}
OpenAPI 3
https://api.sondahub.com/v1/fleet/openapi.json
GraphQL
https://api.sondahub.com/v1/fleet/graphql
JSON file
https://api.sondahub.com/data/fleet/sites.json
MCP
https://api.sondahub.com/mcp · list_records
The first three sites
curl "https://api.sondahub.com/v1/fleet/sites?limit=3"

Sample records

Records 1 to 3 of 40, exactly as GET /v1/fleet/sites/{id} answers them. The data file holds all of them.

[
  {
    "id": 1,
    "created_at": "2024-04-05T10:29:32Z",
    "updated_at": "2024-04-05T10:29:32Z",
    "code": "BOM-01",
    "name": "Mumbai Warehouse",
    "kind": "warehouse",
    "address": {
      "line1": "2962 Lincoln Ter",
      "city": "Mumbai",
      "region": "Maharashtra",
      "postal_code": "VSK6Y8",
      "country": "IN"
    },
    "timezone": "Asia/Kolkata",
    "lat": 18.941,
    "lon": 72.9,
    "device_count": 8,
    "status": "active"
  },
  {
    "id": 2,
    "created_at": "2025-04-24T21:44:41Z",
    "updated_at": "2025-04-24T21:44:41Z",
    "code": "MAD-01",
    "name": "Madrid Depot",
    "kind": "depot",
    "address": {
      "line1": "8841 River Ct",
      "city": "Madrid",
      "region": "Madrid",
      "postal_code": "KBZGD0",
      "country": "ES"
    },
    "timezone": "Europe/Madrid",
    "lat": 40.3872,
    "lon": -3.5779,
    "device_count": 14,
    "status": "active"
  },
  {
    "id": 3,
    "created_at": "2024-06-13T13:35:30Z",
    "updated_at": "2024-06-13T13:35:30Z",
    "code": "MXP-01",
    "name": "Milan Clinic",
    "kind": "clinic",
    "address": {
      "line1": "9415 Elm Dr",
      "city": "Milan",
      "region": "Lombardy",
      "postal_code": "EHVT1B",
      "country": "IT",
      "line2": "Suite 245"
    },
    "timezone": "Europe/Rome",
    "lat": 45.3632,
    "lon": 9.2642,
    "device_count": 16,
    "status": "active"
  }
]

Fields

FieldTypeNotes
idread-onlyintAssigned by the server. Seed records keep their ids across restarts; records you create continue after the seed.
created_atread-onlydatetimeWhen the record was created (ISO 8601, UTC).
updated_atread-onlydatetimeWhen the record last changed.
coderequiredstring
namerequiredstring
kindenumwarehouse office plant store datacenter farm clinic depot
addressjson { line1, city, region, postal_code, country }
timezonestring
latfloat
lonfloat
device_countread-onlyint
statusenumactive maintenance decommissioned

Relations: devices → the devices whose site_id is this site. Use ?expand=devices to embed them, or the nested routes.

Endpoints

GET/v1/fleet/sitesA page, with every filter, sort, search, field and expand option.
POST/v1/fleet/sitesCreate one: 201 with the record, its id, a Location header and the session token that keeps it; 422 names each field that is wrong.
GET/v1/fleet/sites/{id}One record, with an ETag; If-None-Match earns a 304.
PATCH/v1/fleet/sites/{id}Change the fields you send.
PUT/v1/fleet/sites/{id}Replace the record; required fields must all be there.
DELETE/v1/fleet/sites/{id}Answers 200 with what was removed (a real server’s 204 lives at /v1/utils/status/204); gone for the session.
GET/v1/fleet/sites/{id}/devicesIts devices, as a page with all the list options.

Try it

List with a filter
curl "https://api.sondahub.com/v1/fleet/sites?kind=office&lat_gte=10&limit=3"
One record
curl https://api.sondahub.com/v1/fleet/sites/1
Its devices
curl "https://api.sondahub.com/v1/fleet/sites/1/devices?limit=5"
Create
curl -i -X POST https://api.sondahub.com/v1/fleet/sites \
  -H "Content-Type: application/json" \
  -d '{"code":"MIA-01","name":"Miami Warehouse","kind":"warehouse","timezone":"America/New_York","status":"active"}'
Read it back: newest first (send the session token)
curl "https://api.sondahub.com/v1/fleet/sites?sort=-id&limit=3" \
  -H "X-Sondahub-Session: THE_TOKEN_FROM_THE_CREATE"
Change one field
curl -X PATCH https://api.sondahub.com/v1/fleet/sites/1 \
  -H "Content-Type: application/json" \
  -d '{"kind":"office"}'
Delete the one you created
curl -X DELETE https://api.sondahub.com/v1/fleet/sites/41 \
  -H "X-Sondahub-Session: THE_TOKEN_FROM_THE_CREATE"

Query recipes

Every list option works on sites; these are ready to paste. All the options.

WhatRequest
Page 2, 50 at a time (of 40)/v1/fleet/sites?page=2&limit=50
Only kind = warehouse/v1/fleet/sites?kind=warehouse
Lat between two values, largest first/v1/fleet/sites?lat_gte=1&lat_lte=500&sort=-lat
Newest first by created at/v1/fleet/sites?sort=-created_at&limit=5
Code contains “bom”/v1/fleet/sites?code_like=bom
Full-text search/v1/fleet/sites?q=bom
Only some fields/v1/fleet/sites?fields=id,code&limit=5
Its devices (nested route)/v1/fleet/sites/1/devices?limit=5
Just the count/v1/fleet/sites?limit=1&fields=id

GraphQL

The same sites as the sites query on https://api.sondahub.com/v1/fleet/graphql, and one site as site(id: 1). Introspection is on. More on the GraphQL API.

{
  sites(limit: 3, sort: "-id", filter: { kind: warehouse }) {
    total
    data {
      id code name kind
      devices(limit: 2) { id }
    }
  }
}
Run it
curl https://api.sondahub.com/v1/fleet/graphql -H "Content-Type: application/json" -d '{"query": "{ sites(limit: 3, sort: \"-id\", filter: { kind: warehouse }) { total data { id code name kind devices(limit: 2) { id } } } }"}'

From an AI agent (MCP)

The MCP server reaches the same rows with list_records, get_record, create_record, update_record and delete_record, and as the resource sondahub://fleet/sites.

tools/call
curl https://api.sondahub.com/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_records","arguments":{"api":"fleet","collection":"sites","filters":{"kind":"warehouse"},"limit":3}}}'

More in the Fleet API

devices (500) · readings (4,908) · alerts (500) · commands (300)

The live streams, the MQTT broker, and the whole API on one page: Fleet API. Other worlds: fake e-commerce API, fake banking API, fake social media API, fake helpdesk API, fake flight booking API, fake user directory API.