© 2025 OneNata
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.
OneNata Pet Smart Device API is a RESTful API that provides developers with complete smart pet device management capabilities. Through our API, you can:
Add and validate smart pet devices
Get device status and health data
Send control commands to devices
Receive device status change notifications
Base URL: https://api.onenata.com/v1
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.
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 /devices
Authorization: Bearer YOUR_API_KEY
OneNata supports various smart pet devices, each with dedicated API interfaces:
Automatic feeding, scheduled dispensing, portion control
Real-time location, track history, safety zones
Automatic water supply, quality monitoring, drinking statistics
Remote monitoring, two-way audio, smart recognition
Auto cleaning, health monitoring, odor control
Interactive entertainment, activity tracking, smart companion
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
}
}
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"
}
}
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"
}
}
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"
}
}
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"
}
}
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
}
}
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"
}
}
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
}
}
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"
}
}
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": []
}
}
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"
}
}
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"
}
}
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"
}
}
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"
}
}
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"
}
}
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"
}
}
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"
}
}
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"
}
}
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
}
}
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"
}
}
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
}
}
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"
}
}
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"]
}
}
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"
}
}
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"
}
}
Get real-time status information of devices, including online status, battery level, sensor data, etc.
GET /devices/{deviceId}/status
Authorization: Bearer YOUR_API_KEY
{
"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": []
}
}
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"
}
}
feed
- Feed petplay_sound
- Play soundset_temperature
- Set temperaturetake_photo
- Take photostart_video
- Start videofeed
- Feed immediatelysetSchedule
- Set feeding schedulepauseSchedule
- Pause schedulecheckFood
- Check food levelgetLocation
- Get current locationsetFence
- Set geo-fenceenableSOS
- Enable SOS modegetHistory
- Get track historystartPump
- Start water pumpcheckWater
- Check water leveltestQuality
- Test water qualityreplaceFilter
- Filter replacement remindertakePhoto
- Take photostartRecord
- Start recordingenableNightVision
- Enable night visionstartTalk
- Start two-way talkstartClean
- Start cleaningcheckStatus
- Check statusenableDeodorize
- Enable deodorizergetUsageStats
- Get usage statisticsstartPlay
- Start playingsetMode
- Set play modeenableAuto
- Enable auto modegetActivity
- Get activity dataConfigure 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"]
}
{
"event": "device.status.changed",
"timestamp": "2024-01-15T10:30:00Z",
"data": {
"deviceId": "device_001",
"status": {
"isOnline": true,
"batteryLevel": 75,
"temperature": 25.5
}
}
}
// 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();
}
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})
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.
Complete technical documentation for device integration
Join our developer community to exchange experiences with other developers and get the latest API updates.
Join CommunityHaving technical issues? Our technical support team is always ready to help you.
Email: api-support@onenata.com
Response Time: Within 24 hours