Overview
The OWL DMS API provides a clean, reliable interface for accessing data from the OWL Mesh Network. Instead of dealing with the complexity of distributed data sources, you can use a single, consistent API to query and retrieve the information you need.
This makes it easy to plug mesh-network data into your dashboards, analytics pipelines, or internal tools without needing to understand the underlying network architecture.
Create API Key
Follow these steps to create your API key:
- Log into your OWL DMS
- Navigate to
Settings > API Keys
- Click on
New API Key
- Fill in the details and click on
Create Key
- OWL DMS will generate an API Key for you. Save the key for your application
Keep your API keys secure and never share them publicly. Treat them like passwords. Once created, you won’t be able to view the full key again.
Use API Key
Once you have your API key from the steps above, you can integrate it into your application. Here are some ways to use the API key to get access to your OWL Mesh data.
Python Example
import requests
url = "https://{YOUR OWN OWL INSTANCE}.owldms.com/public_api/Data"
headers = {
"accept": "application/json",
"X-API-Key": "YOUR API KEY HERE"
}
params = {
"startDate": YOUR_START_DATE_HERE, # Unix timestamp (type:int)
# "endDate" : YOUR_END_DATE_HERE # Unix timestamp (type:int) (OPTIONAL)
}
response = requests.get(url, headers=headers, params=params)
data = response.json()
print(data)
JavaScript Example
const url = "https://{YOUR OWN OWL INSTANCE}.owldms.com/public_api/Data";
const headers = {
"accept": "application/json",
"X-API-Key": "YOUR API KEY HERE"
};
const params = new URLSearchParams({
startDate: YOUR_START_DATE_HERE, // Unix timestamp (type:int)
// endDate: YOUR_END_DATE_HERE // Unix timestamp (type:int) (OPTIONAL)
});
async function getData() {
try {
const response = await fetch(`${url}?${params.toString()}`, {
method: "GET",
headers: headers
});
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
const data = await response.json();
console.log(data);
} catch (err) {
console.error("API call failed:", err);
}
}
getData();
API Parameters
| Parameter | Type | Required | Description |
|---|
startDate | integer | Yes | Unix timestamp for the start of the data range |
endDate | integer | No | Unix timestamp for the end of the data range. If omitted, returns data up to the current time |
Use Unix timestamps (seconds since January 1, 1970) for the date parameters. You can convert dates to Unix timestamps using online converters or programming language utilities.
Every request returns a JSON payload, where each entry is itself a JSON object representing an individual message from the mesh. No protocol wrangling. No decoding headaches. Just structured data delivered in a predictable format.
Here is an example of how the retrieved data will look:
{
{
"deviceId": "PAPADUCK",
"timestamp": "2025-11-30T17:08:54.137Z",
"eventType": "health",
"payload": {
"hops": 1,
"Payload": {
"voltage": 3.65,
"percentage": 17,
"charging": true,
"temp": 57.0
},
"DeviceID": "DUCK0001",
"duckType": 2,
"MessageID": "SB6W"
}
},
{
"deviceId": "PAPADUCK",
"timestamp": "2025-11-30T17:08:54.137Z",
"eventType": "health",
"payload": {
"hops": 1,
"Payload": {
"voltage": 3.65,
"percentage": 17,
"charging": true,
"temp": 57.0
},
"DeviceID": "DUCK1234",
"duckType": 2,
"MessageID": "SB6W"
}
}
}
Response Fields
| Field | Type | Description |
|---|
deviceId | string | Identifier of the device that reported this message |
timestamp | string | ISO 8601 timestamp when the message was received |
eventType | string | Type of event (e.g., “health”, “sensor”, “alert”) |
payload.hops | integer | Number of hops this message traveled through the mesh |
payload.Payload | object | Device-specific data including voltage, battery percentage, charging status, and temperature |
payload.DeviceID | string | Unique identifier of the originating device |
payload.duckType | integer | Type of device (e.g., 2 for standard duck) |
payload.MessageID | string | Unique message identifier |
Complete Example
Here’s a complete working example that fetches data from the last 24 hours:
import requests
from datetime import datetime, timedelta
# Configuration
OWL_INSTANCE = "yourcompany" # Replace with your instance name
API_KEY = "your_api_key_here" # Replace with your API key
# Calculate Unix timestamp for 24 hours ago
start_time = int((datetime.now() - timedelta(days=1)).timestamp())
# API endpoint
url = f"https://{OWL_INSTANCE}.owldms.com/public_api/Data"
# Headers
headers = {
"accept": "application/json",
"X-API-Key": API_KEY
}
# Parameters
params = {
"startDate": start_time
}
# Make the request
response = requests.get(url, headers=headers, params=params)
# Check if request was successful
if response.status_code == 200:
data = response.json()
print(f"Retrieved {len(data)} messages")
for message in data:
print(f"Device: {message['deviceId']}, Time: {message['timestamp']}")
else:
print(f"Error: {response.status_code}")
Support
Need help with the API?