Skip to main content

NetBox Custom Widget

A NetBox plugin that provides configurable dashboard widgets for calling external APIs and displaying results. Similar to Homepage's Custom API widget.

Features

  • Call any HTTP API endpoint (GET/POST) and display JSON results on your NetBox dashboard
  • Configurable field mappings with dot-notation for nested JSON access
  • Auto-refresh via HTMX at configurable intervals
  • Multiple display modes: list, block, grid, table
  • Three color systems: adaptive (keyword-based), static (fixed), threshold (numeric ranges)
  • Pre-define endpoints in plugin configuration for automatic provisioning
  • Full CRUD interface for managing API endpoints
  • Custom link button on each widget

Installation

pip install netbox-custom-widget

Add to your NetBox configuration:

PLUGINS = ['netbox_custom_widget']

Configuration

Define API endpoints in your plugins.py:

PLUGINS_CONFIG = {
    'netbox_custom_widget': {
        'verify_ssl': False,
        'endpoints': [
            {
                'name': 'My API Status',
                'url': 'https://api.example.com/status',
                'headers': {'Authorization': 'Bearer token123'},
                'mappings': [
                    {'field': 'status', 'label': 'Status', 'color': 'adaptive'},
                    {'field': 'uptime', 'label': 'Uptime', 'suffix': 'hours'},
                ],
                'display_mode': 'list',
                'refresh_interval': 30,
                'link': 'https://api.example.com/dashboard',
            },
        ],
    }
}

Display Options

Optional PLUGINS_CONFIG["netbox_custom_widget"] keys that control where the plugin appears in the UI:

Setting Default Description
top_level_menu True True = own top-level sidebar menu. False = items listed under the shared Plugins menu, to shorten the sidebar.

Display Modes

Mode Description Best For
list Label on left, value/badge on right Process status, key-value pairs
block Large centered badge with label below Single metrics, ticket counts
grid PRTG-style badges side-by-side Multi-metric summaries
table Standard table layout Tabular data

Color Options

Adaptive ("color": "adaptive")

Automatically colors based on keywords in the value text:

Keywords Color
active, insvc, in service Blue
up, ok, running, online, healthy, on duty Green
down, isolated, error, failed, offline, critical Red
standby, idle, not active, configured, warning, degraded, paused Orange

Static ("color": "<name>")

Fixed color applied to the field. Available names: success (green), warning (orange), danger (red), info (cyan), primary (blue), secondary (muted).

Threshold ("color": "threshold")

Numeric range-based coloring. Rules are evaluated top-to-bottom, first match wins:

{
    'field': 'ticket_count',
    'label': 'Open Tickets',
    'color': 'threshold',
    'thresholds': [
        {'lt': 5, 'color': 'green'},    # < 5: green
        {'lt': 15, 'color': 'orange'},   # < 15: orange
        {'color': 'red'},                # default: red
    ],
}

Supports lt (less than) and gt (greater than). Available colors: red, orange, green, blue, cyan, purple, yellow.

Mapping Options

Each mapping in the mappings array supports:

Key Type Description
field string Required. Dot-notation path to JSON value (e.g., "data.status", "0.name")
label string Display label
additional_field string Second field shown on same row
color string "adaptive", "threshold", or a static color name
thresholds array Threshold rules (when color is "threshold")
format string "text" (default) or "number" (adds comma separators)
suffix string Appended text (e.g., "hours", "ms")

Endpoint Fields

Field Type Default Description
name string Required. Display name (also used as widget title)
url string Required. API endpoint URL (max 2000 chars)
http_method string GET GET or POST
headers dict {} Custom HTTP headers
body string "" Request body (POST only)
mappings array [] Field mapping configuration
display_mode string list list, block, grid, or table
refresh_interval int 30 Auto-refresh seconds (0 to disable)
verify_ssl bool true Verify SSL certificates
timeout int 30 Request timeout seconds
link string "" Custom URL button on widget
description string "" Optional notes

Examples

Single Number Widget (Block Mode)

Display a single metric as a large centered badge — ideal for ticket counts, sensor totals, or any numeric KPI:

{
    'name': 'JIRA Open Tickets',
    'url': 'https://api.example.com/tickets/count',
    'headers': {'Authorization': 'Bearer token123'},
    'mappings': [
        {
            'field': 'total',
            'label': 'Open Tickets',
            'color': 'threshold',
            'thresholds': [
                {'lt': 5, 'color': 'green'},
                {'lt': 15, 'color': 'orange'},
                {'color': 'red'},
            ],
        },
    ],
    'display_mode': 'block',
    'refresh_interval': 30,
    'link': 'https://jira.example.com/dashboard',
}

This renders a large color-coded badge with the count, and "Open Tickets" label underneath. The widget title auto-populates from the endpoint name.

Multi-Metric Summary (Grid Mode)

Display multiple counts side-by-side with PRTG-style badges:

{
    'name': 'Ticket Summary',
    'url': 'https://api.example.com/tickets/summary',
    'mappings': [
        {'field': 'total', 'label': 'Total', 'color': 'threshold',
         'thresholds': [{'lt': 5, 'color': 'green'}, {'lt': 15, 'color': 'orange'}, {'color': 'red'}]},
        {'field': 'in_progress', 'label': 'In Progress', 'color': 'primary'},
        {'field': 'waiting', 'label': 'Waiting', 'color': 'warning'},
    ],
    'display_mode': 'grid',
    'refresh_interval': 60,
}

Process Status Monitoring (List Mode)

Monitor services with adaptive color coding:

{
    'name': 'Server Processes',
    'url': 'https://api.example.com/processes',
    'mappings': [
        {'field': '0.name', 'additional_field': '0.status', 'color': 'adaptive'},
        {'field': '1.name', 'additional_field': '1.status', 'color': 'adaptive'},
    ],
    'display_mode': 'list',
    'refresh_interval': 5,
}

Status values like "Active", "Running", "Down", or "Standby" are automatically color-coded.

Public API Demo (No Auth Required)

Try these examples out of the box to test the plugin:

# NVD CVE Database — large badge with total CVE count
{
    'name': 'NVD CVE Database',
    'url': 'https://services.nvd.nist.gov/rest/json/cves/2.0?resultsPerPage=0',
    'mappings': [
        {'field': 'totalResults', 'label': 'Total CVEs', 'format': 'number', 'color': 'danger'},
    ],
    'display_mode': 'block',
    'refresh_interval': 3600,
    'link': 'https://nvd.nist.gov/',
}

# GitHub Repo Stats — stars, issues, forks side-by-side
{
    'name': 'NetBox GitHub',
    'url': 'https://api.github.com/repos/netbox-community/netbox',
    'mappings': [
        {'field': 'stargazers_count', 'label': 'Stars', 'format': 'number', 'color': 'warning'},
        {'field': 'open_issues_count', 'label': 'Issues', 'format': 'number', 'color': 'danger'},
        {'field': 'forks_count', 'label': 'Forks', 'format': 'number', 'color': 'primary'},
    ],
    'display_mode': 'grid',
    'refresh_interval': 300,
    'link': 'https://github.com/netbox-community/netbox',
}

Requirements

  • NetBox >= 4.0.0
  • Python >= 3.10

Metadata

Release files for netbox-custom-widget 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for netbox-custom-widget 0.8.0
File Size Uploaded Provenance Actions
netbox_custom_widget-0.8.0.tar.gz 24.1 kB With provenance Details for netbox_custom_widget-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for netbox-custom-widget 0.8.0
File Interpreter ABI Platform Actions
netbox_custom_widget-0.8.0-py3-none-any.whl Python 3 none any Details for netbox_custom_widget-0.8.0-py3-none-any.whl

Total release size: 53.8 kB

Release files / netbox_custom_widget-0.8.0.tar.gz

Download URL netbox_custom_widget-0.8.0.tar.gz
Size 24.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0ac8f5417228b3d8167a92930fc96135da0189b6a675c6b528c1ee1fd4721454
BLAKE2b-256 checksum
How to use checksums
ae3ef2a970526d7c4f57e07f1f79da81b211d29542f1c23d4ff68e0f61357c4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / netbox_custom_widget-0.8.0-py3-none-any.whl

Download URL netbox_custom_widget-0.8.0-py3-none-any.whl
Size 29.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
71c74bb5ea306b881d1b2ea2495366f90a47408354eed1b20161f7a9da500873
BLAKE2b-256 checksum
How to use checksums
57ca0958f9dfa3a0a69faf5e744c5162c8947843e2c81820db70b837db3ef08f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Security for netbox-custom-widget 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for netbox_custom_widget-0.8.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page