Skip to content

Commit dee08b2

Browse files
agnersclaude
andcommitted
Add API Explorer app
Development app with ingress support for inspecting Supervisor ingress proxy headers and testing Home Assistant Core API calls. Provides a web UI with an ingress header inspector, API request builder, and quick action presets for common endpoints. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e4043a5 commit dee08b2

File tree

12 files changed

+557
-0
lines changed

12 files changed

+557
-0
lines changed

api_explorer/DOCS.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# API Explorer
2+
3+
## About
4+
5+
API Explorer is a development and debugging tool for Home Assistant app and integration developers. It lets you see exactly what Supervisor's ingress proxy does to requests and test Core API endpoints without leaving the browser.
6+
7+
## Panels
8+
9+
### Ingress Headers
10+
11+
Displays all HTTP headers arriving at the app after Supervisor's ingress proxy has processed the request. Useful for verifying that user identity headers (`X-Remote-User-Id`, `X-Remote-User-Name`, `X-Remote-User-Display-Name`) and forwarding headers (`X-Forwarded-For`, `X-Forwarded-Host`, `X-Forwarded-Proto`) are set correctly.
12+
13+
### API Request Builder
14+
15+
Send arbitrary HTTP requests to the Home Assistant Core API via the Supervisor proxy. The app authenticates using its `SUPERVISOR_TOKEN` automatically. The full response (status code, headers, and body) is displayed for inspection.
16+
17+
### Quick Actions
18+
19+
One-click buttons for commonly used API endpoints: status, config, states, services, and events.
20+
21+
## Configuration
22+
23+
This app has no configuration options. It uses `homeassistant_api: true` to access the Core API through Supervisor.

api_explorer/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ARG BUILD_FROM
2+
FROM ${BUILD_FROM}
3+
4+
RUN pip3 install --no-cache-dir aiohttp==3.11.12
5+
6+
COPY rootfs /

api_explorer/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# API Explorer
2+
3+
A development app for Home Assistant that provides a web UI (via ingress) to inspect Supervisor ingress behavior and test Home Assistant Core API calls.
4+
5+
## What it does
6+
7+
- **Ingress Header Inspector**: Shows all HTTP headers that Supervisor's ingress proxy sends to apps, including `X-Remote-User-Id`, `X-Remote-User-Display-Name`, `X-Forwarded-For`, etc.
8+
- **API Request Builder**: Make API calls to Home Assistant Core through the Supervisor proxy (`http://supervisor/core/api/...`) with configurable method, path, headers, and JSON body.
9+
- **Quick Actions**: Preset buttons for common Core API endpoints like `/api/states`, `/api/config`, and `/api/services`.
10+
11+
## Usage
12+
13+
1. Copy this folder to `/addons/` on a Home Assistant OS or Supervised system
14+
2. In the HA UI: Settings > Apps > App Store > reload
15+
3. Find "API Explorer" in local apps, install and start
16+
4. Open via the sidebar panel
17+
18+
## Architecture
19+
20+
The app runs a lightweight aiohttp Python server inside an HA base container with s6-overlay. The browser cannot reach `http://supervisor` directly (it's Docker-internal), so the app server acts as a proxy for API calls.

api_explorer/build.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
build_from:
3+
aarch64: ghcr.io/home-assistant/aarch64-base-python:3.13-alpine3.21
4+
amd64: ghcr.io/home-assistant/amd64-base-python:3.13-alpine3.21

api_explorer/config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: API Explorer
2+
version: "1.0.0"
3+
slug: api_explorer
4+
description: Inspect ingress headers and test Home Assistant Core API calls through Supervisor
5+
url: https://www.home-assistant.io
6+
arch:
7+
- amd64
8+
- aarch64
9+
ingress: true
10+
ingress_port: 8099
11+
panel_icon: mdi:api
12+
panel_title: API Explorer
13+
homeassistant_api: true
14+
init: false
15+
startup: application
16+
boot: manual

0 commit comments

Comments
 (0)