Skip to main content

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:
  1. Log into your OWL DMS
  2. Navigate to Settings > API Keys
  3. Click on New API Key
  4. Fill in the details and click on Create Key
  5. 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

ParameterTypeRequiredDescription
startDateintegerYesUnix timestamp for the start of the data range
endDateintegerNoUnix 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.

Data Format

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

FieldTypeDescription
deviceIdstringIdentifier of the device that reported this message
timestampstringISO 8601 timestamp when the message was received
eventTypestringType of event (e.g., “health”, “sensor”, “alert”)
payload.hopsintegerNumber of hops this message traveled through the mesh
payload.PayloadobjectDevice-specific data including voltage, battery percentage, charging status, and temperature
payload.DeviceIDstringUnique identifier of the originating device
payload.duckTypeintegerType of device (e.g., 2 for standard duck)
payload.MessageIDstringUnique 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?