REST API
TS Analyzer exposes a full HTTP REST API. All data visible in the web interface — inputs, stream metrics, ETSI TR 101 290 errors, statistics, PSI/SI tables, EPG, alerts log, and system status — is available via the API. Device configuration and control operations (adding inputs, changing network settings, rebooting) are also supported.
The interactive API reference is available directly on the device at:
http://{device-ip}/api.html— Swagger UI with all endpoints, request/response schemas, and a built-in test consolehttp://{device-ip}/settings/device— Device info page in the web UI, where firmware version and serial number are shown
Base URL
http://<device-ip>/api
Replace <device-ip> with the management interface address (default: 172.16.112.1).
Authentication
The API uses JWT Bearer authentication (RFC 6750). All endpoints except /user/login and /system/alive require a valid token.
Obtaining a token
POST /api/user/login
Content-Type: application/json
{
"role": "admin",
"password": "admin"
}
Response:
{
"role": "admin",
"token": "eyJhbGciOiJIUzI1NiIsInR5..."
}
Using the token
Pass the token in the Authorization header on every subsequent request:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5...
Roles
| Role | Access |
|---|---|
admin |
Full access — read, write, control, system operations |
user |
Read-only access to monitoring data |
Tokens do not expire automatically. Previously issued tokens remain valid after a password change.
Changing a password
POST /api/user/password
Authorization: Bearer <token>
Content-Type: application/json
{
"role": "admin",
"password": "new-secure-password"
}
Response format
All responses use JSON. Errors follow this structure:
{
"code": 404,
"message": "Input not found"
}
Standard HTTP status codes apply: 200 success, 401 missing or invalid token, 405 wrong credentials on login.
Endpoint reference
Inputs
Inputs are monitoring objects — individual transport streams being analyzed. Each input has a numeric id, a user-defined name, a source configuration, and an assigned alert profile.
List all inputs
GET /api/inputs
Returns an array of all configured inputs with their current stream state, error indicators, and metrics (bitrate, IPAT, DF, MLR, DPC, CCE).
Add an input
POST /api/inputs
Content-Type: application/json
{
"name": "ETH MPTS 1",
"config": {
"eth": {
"stream_protocol": 0,
"multicast": {
"multicast_address": "239.1.1.1",
"multicast_port": 1234
}
}
},
"alerts_config": {
"profile_id": 1,
"pid_error_list": []
}
}
Source config variants:
"config": {
"eth": {
"stream_protocol": 0,
"multicast": {
"multicast_address": "239.1.1.1",
"multicast_port": 1234
}
}
}
"config": {
"eth": {
"stream_protocol": 0,
"multicast": {
"multicast_address": "239.1.1.1",
"multicast_port": 1234,
"source_address": "10.0.0.5"
}
}
}
"config": {
"eth": {
"stream_protocol": 0,
"unicast": {
"listen_address": "0.0.0.0",
"listen_port": 5000
}
}
}
"config": {
"asi": {
"port": 1
}
}
"config": {
"t2mi": {
"stream_id": 1,
"service_id": 1010,
"elementary_stream_pid": 4096,
"plp_id": 1012,
"manual": false
}
}
"config": {
"rf": {
"mode": 2,
"frequency": 626000000,
"bandwidth": 8000000,
"plp_id": 0
}
}
Update an input
POST /api/inputs/{id}
Same body as adding an input. The input_id field in the body must match {id} in the path.
Delete an input
DELETE /api/inputs/{id}
Start / Stop monitoring
GET /api/inputs/{id}/start
GET /api/inputs/{id}/stop
Temporarily pause or resume monitoring of an input without deleting it.
Stream data
PID list
GET /api/inputs/{id}/pids
Returns the list of all PIDs in the transport stream with their type, associated service name, and whether they carry PCR.
PSI/SI tables
GET /api/inputs/{id}/tables
Returns all currently decoded PSI/SI tables (PAT, PMT, NIT, SDT, EIT, CAT, TDT, TOT, etc.) as XML strings with per-table bitrate and repetition rate metrics.
POST /api/inputs/{id}/tables
POST variant accepts a metadata object with table IDs and revision numbers — returns only tables that have changed since the specified revision. Used for efficient polling.
EPG data
POST /api/inputs/{id}/epg
Content-Type: application/json
{
"eit_type": "eit",
"service_ids": [1100, 1200],
"transport_stream_id": 101,
"original_network_id": 8492,
"start_time": "2024-01-01T10:00:00Z",
"end_time": "2024-01-01T22:00:00Z"
}
Returns EPG events for the specified services and time range. eit_type can be eit, eit_other, eit_sched, or eit_sched_other.
GET /api/inputs/{id}/epg/parameters
Returns available service IDs, TS IDs, and original network IDs for the EPG query — use this to populate the EPG request.
RF metrics
GET /api/inputs/rf_metrics
Returns RF signal quality measurements: RSSI, BER (pre/post-correction), SNR, FER, PER, uncorrectable packets, carrier offset, timing offset, and full DVB-T2 modulation parameters (constellation, guard interval, FFT mode, PLP info, network/system/cell IDs).
Statistics
Current statistics
GET /api/statistics/current
Returns the current accumulated ETSI TR 101 290 statistics for all inputs and PIDs, including per-error counts (current, sum), status (0 = OK, 1 = warning, 2 = critical), and IP stream metrics (bitrate, DF, MLR, IPAT).
DELETE /api/statistics/current
Resets current statistics counters.
Archive statistics
GET /api/statistics/archive?period=hour&time=2024-01-01T12:00:00Z
Returns statistics for a specific historical period. period values: min, 10min, hour, day, total.
DELETE /api/statistics/archive
Clears the statistics archive.
CAS statistics
GET /api/statistics/cas
Returns CAS stream information for all active inputs: CA system ID, CA system name, ECM PID, EMM PIDs, service association, and PID status.
Alerts log
Query alerts
POST /api/inputs/{id}/alerts?page=1&perPage=50
Content-Type: application/json
{
"period": "hour",
"time": "2024-01-01T12:00:00Z",
"error_code": ["ts_sync_loss", "continuity_count_error"]
}
Returns a paginated list of ETSI TR 101 290 alert events for the input. Filter by time period, specific error codes, and PID. Results include service name, error name, start/end time, count, and severity (none, warning, critical).
Download alerts as CSV
GET /api/inputs/{id}/alerts/download
Input-level alerts
POST /api/inputs/{id}/input_alerts?page=1&perPage=50
Similar to /alerts but for IP-layer events: input_bitrate_error, input_df_error, input_ipat_error, input_mlr_error, input_dpc_error, input_cce_error.
Reset statistics and alerts
GET /api/inputs/{id}/reset_stats_alerts
Clears both statistics and alert log for a specific input.
Metrics time series
Available ranges
GET /api/inputs/metrics/ranges
Returns the available time series ranges: each range has an id, sample_duration (seconds per sample), and max_samples.
All inputs metrics
GET /api/inputs/metrics?rangeId=0&fromTime=1700000000&toTime=1700003600
Returns time series arrays for all inputs: bitrate, payload bitrate, jitter, IPAT, DF, MLR, CCE, CNR.
Single input metrics
GET /api/inputs/{id}/metrics?rangeId=0&pid=256
Same data for one input, with optional filtering by PID.
Alert profiles
GET /api/profiles
POST /api/profiles
POST /api/profiles/{id}
DELETE /api/profiles/{id}
CRUD operations for alert profiles. Each profile contains an array of entries — one per error type — with fields: enabled, error_name, snmp_trap, alert_type (none/warning/critical), threshold, min_value, max_value.
All error names supported in profiles:
ts_sync_loss, sync_byte_error, pat_error2, continuity_count_error, pmt_error2, pid_error, transport_error, crc_error, pcr_repetition_error, pcr_discontinuity_indicator_error, pcr_accuracy_error, pts_error, cat_error, nit_actual_error, nit_other_error, si_repetition_error, unreferenced_pid, sdt_actual_error, sdt_other_error, eit_actual_error, eit_other_error, eit_pf_error, rst_error, tdt_error, empty_buffer_error, data_delay_error, plus all T2-MI errors and IP-layer errors (input_bitrate_error, input_df_error, input_ipat_error, input_mlr_error, input_dpc_error, input_cce_error).
SNMP settings
GET /api/snmp/settings
POST /api/snmp/settings
GET /api/snmp/mib
Read and write SNMP configuration (enabled flag, listen addresses, trap destination addresses). Download the MIB file.
ASI-to-IP converter
GET /api/converter
GET /api/converter/{input_port}
POST /api/converter/{input_port}/start
GET /api/converter/{input_port}/stop
Manage the ASI-to-IP streaming conversion feature. Start requires multicast address, port, interface, and TTL parameters.
SCTE-35
POST /api/inputs/{id}/scte/toggle
POST /api/inputs/{id}/scte
Enable/disable SCTE-35 monitoring per input, and query logged ad insertion markers with their command type, timestamp, duration, and splice event ID.
Video thumbnails
GET /api/inputs/{id}/thumbnails/status
POST /api/inputs/{id}/thumbnails/enable
GET /api/inputs/{id}/thumbnails/disable
Start hardware video decoding for thumbnail extraction on a specific PID, and retrieve the current status and relative image path.
SD card (stream capture)
| Method | Endpoint | Description |
|---|---|---|
POST |
/sdcard/status |
Get card status and storage usage |
POST |
/sdcard/files |
List capture files with size and timestamp |
POST |
/sdcard/prepare/init |
Initialize the SD card |
POST |
/sdcard/prepare/format |
Format the SD card |
GET |
/sdcard/download_token |
Get a one-time download token |
GET |
/sdcard/download?filename=X&token=Y |
Download a capture file (.ts) |
POST |
/sdcard/delete?filename=X |
Delete a specific file |
POST |
/sdcard/delete/all |
Delete all capture files |
SD card status values: ok, recording, downloading, preparing, no_device, device_error, undersized, write_error.
Start / stop recording
POST /api/record/start/{id}
Content-Type: application/json
{
"duration": 60,
"size": 1024
}
duration is in seconds; size is in MB. Either or both can be omitted for unlimited recording.
GET /api/record/stop/{id}
System
| Method | Endpoint | Description |
|---|---|---|
GET |
/system/alive |
Liveness probe — no auth required |
GET |
/system/status |
CPU, RAM, storage, uptime, reboot_needed flag |
GET |
/system/device |
Serial number, firmware version, model |
GET/POST |
/system/network |
Read and write network interface settings |
POST |
/system/hostname |
Set device hostname (takes effect after reboot) |
GET/POST |
/system/datetime |
NTP settings, NTP server list |
GET/POST |
/system/timezone |
Read and set timezone |
GET |
/system/timezone/list |
List all supported timezone strings |
GET |
/system/warnings |
Check if input/bitrate/service limits are exceeded |
GET |
/system/log |
Read system log entries (last 100 by default) |
GET/POST |
/system/log/settings |
Log level and rsyslog forwarding config |
POST |
/system/upgrade |
Upload .swu firmware package |
POST |
/system/reboot |
Reboot the device immediately |
POST |
/system/factory_reset |
Reset to factory defaults and reboot |
Destructive operations
/system/reboot and /system/factory_reset execute immediately on request. They require the admin role. Factory reset will return the device to 172.16.112.1 static IP with default credentials.
Quick-start example
# 1. Obtain token
TOKEN=$(curl -s -X POST http://172.16.112.1/api/user/login \
-H 'Content-Type: application/json' \
-d '{"role":"admin","password":"admin"}' | jq -r .token)
# 2. List all inputs
curl -s http://172.16.112.1/api/inputs \
-H "Authorization: Bearer $TOKEN" | jq .
# 3. Get current TR 101 290 statistics
curl -s http://172.16.112.1/api/statistics/current \
-H "Authorization: Bearer $TOKEN" | jq '.transport_streams[].data.ts_sync_loss'
# 4. Get RF metrics
curl -s http://172.16.112.1/api/inputs/rf_metrics \
-H "Authorization: Bearer $TOKEN" | jq '{rssi: .rssi, ber: .ber, snr: .mode_metrics.cnr}'