API Overview
SiliconWit.IO provides two types of APIs:
| API | Base URL | Auth | Purpose |
|---|---|---|---|
| Device API | siliconwit.io/api/ | Device ID + Access Token | Send data from devices (MQTT or HTTP) |
| Public API | api.siliconwit.io/v1/ | API Key (Bearer token) | Server-to-server integration, read devices & telemetry |
Device API — Sending Data
Section titled “Device API — Sending Data”Two ways to send data from your devices:
| Method | Best For | Endpoint |
|---|---|---|
| MQTT | Always-on devices, real-time streams | mqtt.siliconwit.io:8883 |
| HTTP | Simple integrations, serverless, cellular devices | POST https://siliconwit.io/api/devices/ingest |
HTTP Data Ingestion
Section titled “HTTP Data Ingestion”Send telemetry data via a simple HTTP POST. Uses Device ID and Access Token.
curl -X POST https://siliconwit.io/api/devices/ingest \ -H "Content-Type: application/json" \ -d '{ "device_id": "YOUR_DEVICE_ID", "access_token": "YOUR_ACCESS_TOKEN", "data": { "temperature": 25.5, "humidity": 60 } }'Or with the token in the Authorization header:
curl -X POST https://siliconwit.io/api/devices/ingest \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{ "device_id": "YOUR_DEVICE_ID", "data": { "temperature": 25.5, "humidity": 60 } }'Error Responses
Section titled “Error Responses”| Status | Meaning |
|---|---|
| 400 | Missing device_id, access_token, or data |
| 401 | Invalid device ID or access token |
| 403 | Device is paused |
| 500 | Server error |
MQTT Data Ingestion
Section titled “MQTT Data Ingestion”For persistent connections and real-time streaming, use MQTT:
Broker: mqtt.siliconwit.ioPort: 8883 (TLS required)Username: Your Device IDPassword: Your Access TokenTopic: d/{device_id}/tSee MQTT Basics for full details.
Public API — Server-to-Server
Section titled “Public API — Server-to-Server”The Public API at api.siliconwit.io lets you query your devices, telemetry, and alerts from your own backend, scripts, or third-party tools. It uses API Keys for authentication.
Available on Starter, Business, Scale, and Enterprise plans.
See Public API Reference for all endpoints.
Authentication Summary
Section titled “Authentication Summary”| Use Case | Auth Method | Where to Get |
|---|---|---|
| Device → Platform (MQTT/HTTP) | Device ID + Access Token | Dashboard → Devices → Select device |
| Server → Platform (API) | API Key (swk_...) | Dashboard → Settings → API Keys |
Data Format
Section titled “Data Format”All data payloads should be JSON objects. The platform accepts any JSON structure:
{ "temperature": 25.5, "humidity": 60, "battery": 85, "location": {"lat": -1.29, "lng": 36.82}}Timestamps are added automatically by the server. See Topics & Payloads for payload best practices.
Viewing Data
Section titled “Viewing Data”Once data is flowing, view it in your Dashboard:
- Select a device to see its telemetry
- Data updates live every 15 seconds
- Export to CSV or Excel from the device page
Next Steps
Section titled “Next Steps”- API Keys - Create and manage API keys
- Public API Reference - All endpoints
- HTTP Examples - Code examples for HTTP ingestion
- MQTT Topics & Payloads - Message format guide
- ESP32 Setup - Hardware setup guide