Skip to main content

Viewtron IP Camera HTTP API

Viewtron IP cameras and NVRs expose an HTTP API for programmatic access to device configuration, live video, PTZ control, AI detection settings, alarm management, and real-time event webhooks. The API uses XML payloads over HTTP POST requests with Basic Authentication.

All AI inference runs on the camera hardware — no cloud service, external software, or per-device licensing required. All Viewtron products are NDAA compliant.

What You Can Do

  • Receive real-time AI detection webhooks — HTTP POST events when cameras detect humans, vehicles, faces, or license plates, with snapshot images and bounding box coordinates
  • Control PTZ cameras — pan, tilt, zoom, focus, presets, cruise tours
  • Track objects continuously — real-time target position data via traject streaming at ~7 updates/sec
  • Read and capture license plates — LPR with plate database management and gate access control via Wiegand
  • Detect and recognize faces — face detection with attributes (age, sex, glasses, mask) and face matching
  • Count people and vehicles — entrance/exit counting by line or area with statistics
  • Configure AI detection zones — intrusion zones, line crossing, region entry/exit, loitering, parking violations
  • Capture snapshots — live JPEG snapshots and time-based recording search via RTSP
  • Control alarm outputs — trigger relays, sirens, and strobe lights programmatically
  • Query device status — model info, firmware version, disk capacity, channel configuration

Documentation Layers

This documentation is organized in four layers, from low-level protocol to ready-made integrations:

1. API Reference — Raw HTTP Endpoints

The API Reference documents every HTTP endpoint exposed by Viewtron cameras and NVRs. All requests use HTTP POST with XML payloads and Basic Authentication. This is language-agnostic — any HTTP client in any language can use it directly.

2. SDK Reference — Python & Node.js Libraries

The SDKs wrap the raw API with typed objects, built-in HTTP servers for receiving webhook events, and automatic IPC/NVR version handling.

  • Python SDK Referencepip install viewtron — ViewtronServer receives events, ViewtronEvent parses them, ViewtronCamera manages plate databases
  • Node.js SDK Referencenpm install viewtron-sdk — EventEmitter-based server with the same event model

Developers who don't use our SDKs need to build their own HTTP servers and XML parsing.

3. Applications — Solution Guides

Application guides show how to build real solutions using the API and SDKs — human detection, LPR gate access, face detection, PTZ control, people counting, and more. Each guide includes working code in both Python and Node.js.

4. Integrations — Home Assistant & Node-RED

Pre-built integrations for Home Assistant (MQTT auto-discovery) and Node-RED (direct HTTP POST) — no coding required.

Quick Example

import requests
from requests.auth import HTTPBasicAuth

# Query camera info
response = requests.get(
"http://192.168.0.50/GetDeviceInfo",
auth=HTTPBasicAuth("admin", "password123")
)
print(response.text)

# Move a PTZ camera
requests.get(
"http://192.168.0.50/PtzControl/1/ZoomIn",
auth=HTTPBasicAuth("admin", "password123")
)

Applicable Products

All Viewtron IP cameras and Viewtron NVRs support this API. See Supported Products for a complete list with per-product API capabilities.

Quick Start

  1. Authenticate — all requests use Basic Authentication
  2. Install an SDKpip install viewtron (Python) or npm install viewtron-sdk (Node.js)
  3. Test connectivity — send a GetDeviceInfo request to verify access
  4. Explore Applications — browse solution guides to see what you can build
  5. Connect to Home Assistant — set up the Home Assistant integration for smart home automations
  6. Reference endpoints — find detailed request/response docs in the API Reference

Resources

Video Guides & Tutorials

These blog posts and video walkthroughs cover camera setup, installation best practices, and live demos of the API in action.

Questions & Development Inquiries

Mike Haldas is available for questions, consultation, and custom software development for Viewtron API related projects. Email details about your project to mike@viewtron.com.