Virtuino Cloud HTTP API Reference

Professional documentation for the Virtuino Cloud REST API, supporting various authentication methods and data structures.

Authentication: You can provide your API Key via x-api-key header, api_key query parameter, or api_key in the JSON body.

1. Data Uplink (Writing Data)

1a. Single field value for a device

Full URL POST https://cloud.virtuino.com/api/data/post Headers
x-api-key: YOUR_API_KEY
Content-Type: application/json
Body
{ "device_name": "LivingRoom", "field": "temp", "value": 24.5 }
Server Response
{ "success": true, "message": "Stored 1 fields for owner: JohnDoe" }

1b. Single field value without device

// Note: device_id will be NULL in the database if device_name is omitted. Full URL POST https://cloud.virtuino.com/api/data/post Body
{ "api_key": "YOUR_API_KEY", "field": "global_status", "value": 1 }
Server Response
{ "success": true, "message": "Stored 1 fields for owner: JohnDoe" }

1c. Multiple field values for a device

Full URL POST https://cloud.virtuino.com/api/data/post Body
{ 
  "api_key": "YOUR_API_KEY",
  "device_name": "Greenhouse_01", 
  "data": [
    { "field": "humidity", "value": 65 },
    { "field": "soil", "value": 42 }
  ]
}
Server Response
{ "success": true, "message": "Stored 2 fields for owner: JohnDoe" }

1d. Multiple field values with custom timestamp

Full URL POST https://cloud.virtuino.com/api/data/post Body
{ 
  "api_key": "YOUR_API_KEY",
  "device_name": "ESP32_Sensor",
  "time": "2026-03-08T10:00:00Z",
  "data": [
    { "field": "temp", "value": 22.1 },
    { "field": "lux", "value": 450 }
  ]
}
Server Response
{ "success": true, "message": "Stored 2 fields for owner: JohnDoe" }

2. Historical Data Retrieval (Reading Data)

2a. Get last sensor value from device

Full URL GET https://cloud.virtuino.com/api/data/device/LivingRoom/field/temp?latest=true&api_key=YOUR_KEY Server Response
{
  "success": true,
  "field": "temp",
  "latest_entry": {
    "time": "2026-03-08T14:20:00.000Z",
    "value": "24.5",
    "device": "LivingRoom",
    "source": "HTTP"
  }
}

2b. Get last sensor value without device

Full URL GET https://cloud.virtuino.com/api/data/field/global_status?latest=true&api_key=YOUR_KEY Server Response
{
  "success": true,
  "field": "global_status",
  "latest_entry": {
    "time": "2026-03-08T12:00:00.000Z",
    "value": "1",
    "device": "Standalone Field",
    "source": "HTTP"
  }
}

2c. Get all last sensor values from device

Full URL GET https://cloud.virtuino.com/api/data/device/LivingRoom?latest=true&api_key=YOUR_KEY Server Response
{
  "success": true,
  "device": "LivingRoom",
  "time": "2026-03-08T14:20:00.000Z",
  "source": "HTTP",
  "fields": [
    { "field": "temp", "value": "24.5" },
    { "field": "humidity", "value": "55" }
  ]
}

2d. Get last sensor value from device with limit

Full URL GET https://cloud.virtuino.com/api/data/device/LivingRoom/field/temp?limit=5&api_key=YOUR_KEY Server Response
{
  "success": true,
  "field": "temp",
  "count": 5,
  "data": [
    { "time": "2026-03-08T14:20:00Z", "value": "24.5", "device": "LivingRoom", "source": "HTTP" },
    ...
  ]
}

2e. Get last sensor value from device in time period and limit

Full URL GET https://cloud.virtuino.com/api/data/device/LivingRoom/field/temp?from=2026-03-08T00:00:00Z&to=2026-03-08T23:59:59Z&limit=15&api_key=YOUR_KEY Server Response
{
  "success": true,
  "field": "temp",
  "count": 15,
  "data": [ ... ]
}

2f. Get all last values from device in time period and limit

Full URL GET https://cloud.virtuino.com/api/data/device/LivingRoom?from=2026-03-08T00:00:00Z&to=2026-03-08T23:59:59Z&limit=15&api_key=YOUR_KEY Server Response
{
  "success": true,
  "device": "LivingRoom",
  "count": 15,
  "history": [
    {
      "time": "2026-03-08T14:20:00Z",
      "source": "HTTP",
      "fields": [ { "field": "temp", "value": "24.5" } ]
    }
  ]
}

3. Inventory & Device Status

GET Account Inventory (Example with 2 devices)

Full URL GET https://cloud.virtuino.com/api/data/inventory?api_key=YOUR_KEY Server Response
{
  "success": true,
  "owner": "JohnDoe",
  "devices_count": 2,
  "inventory": [
    {
      "device_name": "Kitchen_Unit",
      "status": "online",
      "last_seen": "2026-03-08T14:00:00Z",
      "available_fields": ["temp", "humidity"]
    },
    {
      "device_name": "Office_Sensor",
      "status": "online",
      "last_seen": "2026-03-08T13:45:00Z",
      "available_fields": ["co2", "motion"]
    }
  ]
}

4. Cross-Platform Implementation (15 Records + Time Range)

import requests
url = "https://cloud.virtuino.com/api/data/history"
params = {
    "api_key": "YOUR_KEY",
    "limit": 15,
    "from": "2026-03-08T00:00:00Z",
    "to": "2026-03-08T23:59:59Z"
}
response = requests.get(url, params=params)
print(response.json())
#include <HTTPClient.h>
String url = "https://cloud.virtuino.com/api/data/history?api_key=YOUR_KEY&limit=15&from=2026-03-08T00:00:00Z&to=2026-03-08T23:59:59Z";
http.begin(url);
int httpCode = http.GET();
if (httpCode == 200) Serial.println(http.getString());
const url = "https://cloud.virtuino.com/api/data/history?api_key=YOUR_KEY&limit=15&from=2026-03-08T00:00:00Z&to=2026-03-08T23:59:59Z";
fetch(url).then(res => res.json()).then(console.log);
URL url = new URL("https://cloud.virtuino.com/api/data/history?api_key=YOUR_KEY&limit=15&from=2026-03-08T00:00:00Z&to=2026-03-08T23:59:59Z");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
// Read InputStream...
var response = await http.get(Uri.parse('https://cloud.virtuino.com/api/data/history?api_key=YOUR_KEY&limit=15&from=2026-03-08T00:00:00Z&to=2026-03-08T23:59:59Z'));
print(jsonDecode(response.body));
curl -G "https://cloud.virtuino.com/api/data/history" \
     --data-urlencode "api_key=YOUR_KEY" \
     --data-urlencode "limit=15" \
     --data-urlencode "from=2026-03-08T00:00:00Z" \
     --data-urlencode "to=2026-03-08T23:59:59Z"