© 2025 OneNata

OneNata Pet Smart Device API

Powerful and simple API that makes it easy to integrate and manage smart pet devices. Support unified management of multi-vendor devices, real-time monitoring and remote control.

API Overview

OneNata Pet Smart Device API is a RESTful API that provides developers with complete smart pet device management capabilities. Through our API, you can:

🔗

Device Connection

Add and validate smart pet devices

📊

Real-time Monitoring

Get device status and health data

🎮

Remote Control

Send control commands to devices

🔔

Event Notifications

Receive device status change notifications

Base URL: https://api.onenata.com/v1

Authentication

OneNata API uses API Key for authentication. You need to include your API Key in the request header:

Authorization: Bearer YOUR_API_KEY

Get API Key: Please contact our technical support team to get your API Key.

Device Management

Add Device

Validate and add new smart pet devices to your account.

POST /devices/validate
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "serialNumber": "ON-SF-001",
  "deviceType": "feedingMachine",
  "deviceModel": "piFI",
  "manufacturer": "onenata"
}

Get Device List

GET /devices
Authorization: Bearer YOUR_API_KEY

Device Categories

OneNata supports various smart pet devices, each with dedicated API interfaces:

🍽️

Smart Feeder

Automatic feeding, scheduled dispensing, portion control

Scheduled feeding
Remote dispensing
Food monitoring
Low food alerts
View API Examples
📍

GPS Tracker

Real-time location, track history, safety zones

Real-time location
Track history
Geo-fencing
SOS alerts
View API Examples
💧

Smart Water Fountain

Automatic water supply, quality monitoring, drinking statistics

Auto water supply
Water quality test
Drinking records
Filter reminders
View API Examples
📹

Smart Camera

Remote monitoring, two-way audio, smart recognition

HD video
Two-way audio
Motion detection
Night vision
View API Examples
🏠

Smart Litter Box

Auto cleaning, health monitoring, odor control

Auto cleaning
Usage statistics
Health analysis
Odor elimination
View API Examples
🎾

Smart Toy

Interactive entertainment, activity tracking, smart companion

Auto interaction
Activity stats
Entertainment modes
Remote control
View API Examples

🍽️Smart Feeder API Examples

1. Device Validation

Register a smart feeding machine device to your account.

POST /devices/validate
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "serialNumber": "ON-SF-001",
  "deviceType": "feedingMachine",
  "deviceModel": "piFI",
  "manufacturer": "onenata"
}

Response:

{
  "code": 200,
  "msg": "Feeding machine validated successfully",
  "data": {
    "deviceId": "feeding_machine_001",
    "status": "active",
    "foodLevel": 75,
    "batteryLevel": 90,
    "lastFeedTime": "2024-01-15T08:00:00Z",
    "scheduledFeeds": 3
  }
}

2. Feed Now

Trigger immediate feeding with customizable portion size.

POST /devices/{deviceId}/commands
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "command": "feed",
  "parameters": {
    "amount": 50,
    "schedule": "immediate",
    "portion": "normal",
    "soundAlert": true,
    "recordFeeding": true
  }
}

Response:

{
  "code": 200,
  "msg": "Feeding completed successfully",
  "data": {
    "feedingId": "feed_001",
    "timestamp": "2024-01-15T10:30:00Z",
    "amountDispensed": 50,
    "remainingFood": 1200,
    "nextScheduledFeed": "2024-01-15T18:00:00Z"
  }
}

3. Set Feeding Schedule

Configure automatic feeding schedule with multiple daily meals.

POST /devices/{deviceId}/commands
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "command": "setSchedule",
  "parameters": {
    "schedule": [
      {
        "time": "08:00",
        "amount": 60,
        "enabled": true
      },
      {
        "time": "12:00", 
        "amount": 40,
        "enabled": true
      },
      {
        "time": "18:00",
        "amount": 60,
        "enabled": true
      }
    ],
    "timezone": "UTC",
    "autoAdjust": true
  }
}

Response:

{
  "code": 200,
  "msg": "Feeding schedule updated",
  "data": {
    "scheduleId": "schedule_001",
    "totalDailyFeeds": 3,
    "totalDailyAmount": 160,
    "nextFeedTime": "2024-01-16T08:00:00Z",
    "status": "active"
  }
}

4. Check Food Level

Monitor remaining food quantity and get refill recommendations.

GET /devices/{deviceId}/food-level
Authorization: Bearer YOUR_API_KEY

// Optional query parameters:
// ?includeHistory=true&days=7

Response:

{
  "code": 200,
  "msg": "Food level retrieved",
  "data": {
    "currentLevel": 1200,
    "maxCapacity": 2000,
    "percentage": 60,
    "estimatedDaysRemaining": 7,
    "dailyConsumption": 160,
    "lowLevelAlert": false,
    "refillRecommended": false,
    "lastRefill": "2024-01-10T10:00:00Z"
  }
}

📍GPS Tracker API Examples

1. Device Validation

Validate and register a GPS tracker device to your account.

POST /devices/validate
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "serialNumber": "ON-GPS-001",
  "deviceType": "gpsTracker", 
  "deviceModel": "GPS-Pro",
  "manufacturer": "onenata"
}

Response:

{
  "code": 200,
  "msg": "Device validated successfully",
  "data": {
    "deviceId": "gps_tracker_001",
    "status": "active",
    "batteryLevel": 85,
    "lastSeen": "2024-01-15T10:30:00Z"
  }
}

2. Get Real-time Location

Retrieve the current GPS coordinates and location data.

GET /devices/{deviceId}/location
Authorization: Bearer YOUR_API_KEY

// Optional query parameters:
// ?accuracy=high&includeAddress=true

Response:

{
  "code": 200,
  "msg": "Location retrieved successfully",
  "data": {
    "latitude": 40.7128,
    "longitude": -74.0060,
    "accuracy": 5.2,
    "altitude": 10.5,
    "speed": 0,
    "heading": 0,
    "timestamp": "2024-01-15T10:30:00Z",
    "address": "New York, NY, USA",
    "batteryLevel": 85
  }
}

3. Set Geo-fence

Create a virtual boundary and receive alerts when the pet enters or exits.

POST /devices/{deviceId}/commands
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "command": "setFence",
  "parameters": {
    "latitude": 40.7128,
    "longitude": -74.0060,
    "radius": 500,
    "name": "Home Safe Zone",
    "alertOnExit": true,
    "alertOnEntry": false,
    "enabled": true
  }
}

Response:

{
  "code": 200,
  "msg": "Geo-fence created successfully",
  "data": {
    "fenceId": "fence_001",
    "status": "active",
    "createdAt": "2024-01-15T10:30:00Z"
  }
}

4. Get Location History

Retrieve historical location data for tracking and analysis.

GET /devices/{deviceId}/location/history
Authorization: Bearer YOUR_API_KEY

// Query parameters:
// ?startDate=2024-01-14T00:00:00Z
// &endDate=2024-01-15T23:59:59Z
// &limit=100
// &interval=300

Response:

{
  "code": 200,
  "msg": "Location history retrieved",
  "data": {
    "locations": [
      {
        "latitude": 40.7128,
        "longitude": -74.0060,
        "timestamp": "2024-01-15T10:30:00Z",
        "accuracy": 5.2
      }
    ],
    "totalCount": 150,
    "hasMore": true
  }
}

💧Smart Water Fountain API Examples

1. Device Validation

Register a smart water fountain device to your account.

POST /devices/validate
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "serialNumber": "ON-WF-001",
  "deviceType": "waterFountain",
  "deviceModel": "AquaPure",
  "manufacturer": "onenata"
}

Response:

{
  "code": 200,
  "msg": "Water fountain validated successfully",
  "data": {
    "deviceId": "water_fountain_001",
    "status": "active",
    "waterLevel": 75,
    "filterStatus": "good",
    "lastMaintenance": "2024-01-10T08:00:00Z"
  }
}

2. Check Water Quality

Monitor water quality parameters including pH, TDS, and temperature.

GET /devices/{deviceId}/water-quality
Authorization: Bearer YOUR_API_KEY

// Optional query parameters:
// ?includeHistory=true&hours=24

Response:

{
  "code": 200,
  "msg": "Water quality data retrieved",
  "data": {
    "ph": 7.2,
    "tds": 150,
    "temperature": 22.5,
    "chlorine": 0.1,
    "quality": "excellent",
    "lastTested": "2024-01-15T10:30:00Z",
    "filterLifeRemaining": 85,
    "recommendations": []
  }
}

3. Control Water Pump

Start or stop the water pump with customizable flow settings.

POST /devices/{deviceId}/commands
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "command": "startPump",
  "parameters": {
    "duration": 30,
    "flowRate": "normal",
    "mode": "continuous",
    "autoStop": true,
    "minWaterLevel": 20
  }
}

Response:

{
  "code": 200,
  "msg": "Pump started successfully",
  "data": {
    "commandId": "cmd_001",
    "status": "running",
    "estimatedStopTime": "2024-01-15T11:00:00Z",
    "currentFlowRate": "normal"
  }
}

4. Set Cleaning Mode

Activate automatic cleaning cycle to maintain water freshness.

POST /devices/{deviceId}/commands
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "command": "startClean",
  "parameters": {
    "mode": "deep",
    "duration": 300,
    "useUV": true,
    "drainFirst": true,
    "refillAfter": true
  }
}

Response:

{
  "code": 200,
  "msg": "Cleaning cycle started",
  "data": {
    "cleaningId": "clean_001",
    "status": "in_progress",
    "estimatedCompletion": "2024-01-15T11:05:00Z",
    "currentPhase": "draining"
  }
}

📹Smart Camera API Examples

1. Device Validation

Register a smart pet camera device to your account.

POST /devices/validate
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "serialNumber": "ON-CAM-001",
  "deviceType": "camera",
  "deviceModel": "PetCam-HD",
  "manufacturer": "onenata"
}

Response:

{
  "code": 200,
  "msg": "Camera validated successfully",
  "data": {
    "deviceId": "camera_001",
    "status": "active",
    "resolution": "1080p",
    "nightVision": true,
    "audioSupport": true,
    "storageUsed": "2.5GB"
  }
}

2. Get Live Video Stream

Access real-time video feed from the camera with customizable quality settings.

GET /devices/{deviceId}/stream
Authorization: Bearer YOUR_API_KEY

// Query parameters:
// ?quality=1080p&audio=true&format=hls

Response:

{
  "code": 200,
  "msg": "Stream URL generated",
  "data": {
    "streamUrl": "https://stream.onenata.com/live/camera_001/playlist.m3u8",
    "thumbnailUrl": "https://cdn.onenata.com/thumbnails/camera_001.jpg",
    "quality": "1080p",
    "fps": 30,
    "audioEnabled": true,
    "expiresAt": "2024-01-15T12:30:00Z"
  }
}

3. Take Photo

Capture high-quality photos with timestamp and metadata.

POST /devices/{deviceId}/commands
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "command": "takePhoto",
  "parameters": {
    "quality": "high",
    "timestamp": true,
    "resolution": "1920x1080",
    "format": "jpeg",
    "saveToCloud": true,
    "enableFlash": false
  }
}

Response:

{
  "code": 200,
  "msg": "Photo captured successfully",
  "data": {
    "photoId": "photo_001",
    "url": "https://cdn.onenata.com/photos/camera_001/photo_001.jpg",
    "thumbnailUrl": "https://cdn.onenata.com/thumbnails/photo_001_thumb.jpg",
    "timestamp": "2024-01-15T10:30:00Z",
    "fileSize": "2.5MB",
    "resolution": "1920x1080"
  }
}

4. Start Video Recording

Record video with customizable duration and quality settings.

POST /devices/{deviceId}/commands
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "command": "startRecord",
  "parameters": {
    "duration": 300,
    "quality": "1080p",
    "fps": 30,
    "audio": true,
    "motionDetection": true,
    "autoStop": true,
    "saveToCloud": true
  }
}

Response:

{
  "code": 200,
  "msg": "Recording started successfully",
  "data": {
    "recordingId": "rec_001",
    "status": "recording",
    "startTime": "2024-01-15T10:30:00Z",
    "estimatedEndTime": "2024-01-15T10:35:00Z",
    "quality": "1080p",
    "storageLocation": "cloud"
  }
}

5. Two-way Audio Communication

Enable two-way audio to communicate with your pet remotely.

POST /devices/{deviceId}/commands
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "command": "startTalk",
  "parameters": {
    "duration": 60,
    "volume": 80,
    "noiseReduction": true,
    "echoCancel": true,
    "autoEnd": true
  }
}

Response:

{
  "code": 200,
  "msg": "Two-way audio session started",
  "data": {
    "sessionId": "talk_001",
    "status": "active",
    "audioUrl": "wss://audio.onenata.com/talk/camera_001",
    "maxDuration": 60,
    "expiresAt": "2024-01-15T10:31:00Z"
  }
}

🏠Smart Litter Box API Examples

1. Device Validation

Register a smart litter box device to your account.

POST /devices/validate
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "serialNumber": "ON-LB-001",
  "deviceType": "litterBox",
  "deviceModel": "AutoClean-Pro",
  "manufacturer": "onenata"
}

Response:

{
  "code": 200,
  "msg": "Litter box validated successfully",
  "data": {
    "deviceId": "litterbox_001",
    "status": "active",
    "litterLevel": 85,
    "wasteLevel": 15,
    "lastCleaned": "2024-01-15T08:00:00Z",
    "odorControl": "active"
  }
}

2. Get Usage Statistics

Monitor pet usage patterns and litter box health metrics.

GET /devices/{deviceId}/usage-stats
Authorization: Bearer YOUR_API_KEY

// Query parameters:
// ?period=7d&includeHealth=true&timezone=UTC

Response:

{
  "code": 200,
  "msg": "Usage statistics retrieved",
  "data": {
    "period": "7d",
    "totalVisits": 42,
    "averageVisitsPerDay": 6,
    "averageDuration": 180,
    "litterLevel": 85,
    "wasteLevel": 15,
    "healthMetrics": {
      "frequencyNormal": true,
      "durationNormal": true,
      "alerts": []
    },
    "maintenanceNeeded": false
  }
}

3. Start Cleaning Cycle

Initiate automatic cleaning with customizable settings.

POST /devices/{deviceId}/commands
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "command": "startClean",
  "parameters": {
    "mode": "deep",
    "delay": 0,
    "duration": 180,
    "useDeodorizer": true,
    "autoRefill": true,
    "safetyCheck": true
  }
}

Response:

{
  "code": 200,
  "msg": "Cleaning cycle started",
  "data": {
    "cleaningId": "clean_001",
    "status": "in_progress",
    "mode": "deep",
    "startTime": "2024-01-15T10:30:00Z",
    "estimatedCompletion": "2024-01-15T10:33:00Z",
    "currentPhase": "waste_removal"
  }
}

4. Pet Health Monitoring

Get insights into your pet's health based on litter box usage patterns.

GET /devices/{deviceId}/health-insights
Authorization: Bearer YOUR_API_KEY

// Query parameters:
// ?period=30d&includeRecommendations=true

Response:

{
  "code": 200,
  "msg": "Health insights generated",
  "data": {
    "period": "30d",
    "overallHealth": "good",
    "patterns": {
      "frequencyTrend": "stable",
      "durationTrend": "normal",
      "timeOfDayPattern": "consistent"
    },
    "alerts": [],
    "recommendations": [
      "Maintain current feeding schedule",
      "Consider increasing water intake"
    ],
    "vetConsultation": false
  }
}

🎾Smart Toy API Examples

1. Device Validation

Register a smart interactive toy device to your account.

POST /devices/validate
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "serialNumber": "ON-TOY-001",
  "deviceType": "smartToy",
  "deviceModel": "PlayMate-AI",
  "manufacturer": "onenata"
}

Response:

{
  "code": 200,
  "msg": "Smart toy validated successfully",
  "data": {
    "deviceId": "smart_toy_001",
    "status": "active",
    "batteryLevel": 90,
    "playModes": ["interactive", "automatic", "training"],
    "aiEnabled": true,
    "lastPlaySession": "2024-01-14T16:30:00Z"
  }
}

2. Get Activity Data

Monitor pet activity levels and play session analytics.

GET /devices/{deviceId}/activity
Authorization: Bearer YOUR_API_KEY

// Query parameters:
// ?period=7d&includeCalories=true&timezone=UTC

Response:

{
  "code": 200,
  "msg": "Activity data retrieved",
  "data": {
    "period": "7d",
    "totalPlayTime": 420,
    "averageSessionDuration": 15,
    "totalSessions": 28,
    "caloriesBurned": 350,
    "activityLevel": "high",
    "favoritePlayMode": "interactive",
    "peakActivityHours": ["08:00", "18:00"],
    "recommendations": ["Increase play duration", "Try training mode"]
  }
}

3. Start Play Session

Initiate interactive play sessions with customizable settings.

POST /devices/{deviceId}/commands
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "command": "startPlay",
  "parameters": {
    "mode": "interactive",
    "duration": 600,
    "intensity": "medium",
    "adaptToMood": true,
    "enableAI": true,
    "soundEffects": true,
    "autoAdjust": true
  }
}

Response:

{
  "code": 200,
  "msg": "Play session started",
  "data": {
    "sessionId": "play_001",
    "status": "active",
    "mode": "interactive",
    "startTime": "2024-01-15T10:30:00Z",
    "estimatedEndTime": "2024-01-15T10:40:00Z",
    "currentIntensity": "medium",
    "aiAdaptation": "enabled"
  }
}

4. Training Mode

Activate training mode to teach new behaviors and tricks.

POST /devices/{deviceId}/commands
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "command": "startTraining",
  "parameters": {
    "skill": "fetch",
    "difficulty": "beginner",
    "duration": 300,
    "rewardSystem": true,
    "progressTracking": true,
    "voiceCommands": true,
    "customCues": ["good boy", "well done"]
  }
}

Response:

{
  "code": 200,
  "msg": "Training session started",
  "data": {
    "trainingId": "train_001",
    "status": "active",
    "skill": "fetch",
    "difficulty": "beginner",
    "progress": 0,
    "estimatedCompletion": "2024-01-15T10:35:00Z",
    "currentPhase": "introduction"
  }
}

Real-time Monitoring

Get real-time status information of devices, including online status, battery level, sensor data, etc.

GET /devices/{deviceId}/status
Authorization: Bearer YOUR_API_KEY

Response Example:

{
  "code": 200,
  "msg": "Success",
  "data": {
    "deviceId": "device_001",
    "isOnline": true,
    "batteryLevel": 75,
    "lastReportTime": "2024-01-15T10:30:00Z",
    "status": {
      "temperature": 25.5,
      "humidity": 60,
      "feedCount": 3,
      "waterLevel": 80
    },
    "alerts": []
  }
}

Remote Control

Send control commands to devices. Different device types support different control functions.

POST /devices/{deviceId}/commands
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "command": "feed",
  "parameters": {
    "amount": 50,
    "schedule": "immediate"
  }
}

Supported Commands:

  • feed - Feed pet
  • play_sound - Play sound
  • set_temperature - Set temperature
  • take_photo - Take photo
  • start_video - Start video

Device-Specific Commands

🍽️Smart Feeder Commands

  • feed - Feed immediately
  • setSchedule - Set feeding schedule
  • pauseSchedule - Pause schedule
  • checkFood - Check food level

📍GPS Tracker Commands

  • getLocation - Get current location
  • setFence - Set geo-fence
  • enableSOS - Enable SOS mode
  • getHistory - Get track history

💧Smart Water Fountain Commands

  • startPump - Start water pump
  • checkWater - Check water level
  • testQuality - Test water quality
  • replaceFilter - Filter replacement reminder

📹Smart Camera Commands

  • takePhoto - Take photo
  • startRecord - Start recording
  • enableNightVision - Enable night vision
  • startTalk - Start two-way talk

🏠Smart Litter Box Commands

  • startClean - Start cleaning
  • checkStatus - Check status
  • enableDeodorize - Enable deodorizer
  • getUsageStats - Get usage statistics

🎾Smart Toy Commands

  • startPlay - Start playing
  • setMode - Set play mode
  • enableAuto - Enable auto mode
  • getActivity - Get activity data

Webhooks

Configure Webhook URL to receive real-time notifications of device status changes.

POST /webhooks
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY

{
  "url": "https://your-app.com/webhook/device-status",
  "events": ["device.status.changed", "device.offline", "device.alert"]
}

Webhook Payload Example:

{
  "event": "device.status.changed",
  "timestamp": "2024-01-15T10:30:00Z",
  "data": {
    "deviceId": "device_001",
    "status": {
      "isOnline": true,
      "batteryLevel": 75,
      "temperature": 25.5
    }
  }
}

Code Examples

JavaScript

// Get device status
async function getDeviceStatus(deviceId) {
  const response = await fetch(`https://api.onenata.com/v1/devices/${deviceId}/status`, {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    }
  });
  
  const data = await response.json();
  return data;
}

// Send control command
async function feedPet(deviceId, amount) {
  const response = await fetch(`https://api.onenata.com/v1/devices/${deviceId}/commands`, {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      command: 'feed',
      parameters: { amount }
    })
  });
  
  return await response.json();
}

Python

import requests

class OneNataAPI:
    def __init__(self, api_key):
        self.api_key = api_key
        self.base_url = "https://api.onenata.com/v1"
        self.headers = {
            "Authorization": f"Bearer {api_key}",
            "Content-Type": "application/json"
        }
    
    def get_device_status(self, device_id):
        url = f"{self.base_url}/devices/{device_id}/status"
        response = requests.get(url, headers=self.headers)
        return response.json()
    
    def send_command(self, device_id, command, parameters=None):
        url = f"{self.base_url}/devices/{device_id}/commands"
        data = {"command": command}
        if parameters:
            data["parameters"] = parameters
        
        response = requests.post(url, headers=self.headers, json=data)
        return response.json()

# Usage example
api = OneNataAPI("YOUR_API_KEY")
status = api.get_device_status("device_001")
result = api.send_command("device_001", "feed", {"amount": 50})

Device Manufacturer Partnership

Become a Partner in the OneNata Ecosystem

If you are a smart pet device manufacturer, we invite you to join the OneNata ecosystem. Through our device connection documentation, you can easily integrate your products into our platform.

  • Quick Integration: Standardized API interfaces simplify development
  • Complete Documentation: Detailed technical docs and code examples
  • Technical Support: Professional team provides integration support
  • Certification Program: Official certification enhances competitiveness
View Device Connection Docs

Device Integration Guide

Complete technical documentation for device integration

Communication Protocol Specs
Security Authentication
Complete Code Examples

Technical Support

Developer Community

Join our developer community to exchange experiences with other developers and get the latest API updates.

Join Community

Technical Support

Having technical issues? Our technical support team is always ready to help you.

Email: api-support@onenata.com

Response Time: Within 24 hours

OneNata

Danta & Crossiant Technology Ltd

Address

3331 Brown Road, Richmond, BC, Canada

Phone:+1 778 866 7555
Email:onenata.service@gmail.com

© 2025 Danta & Crossiant Technology Ltd. All rights reserved.