Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions api_explorer/DOCS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# API Explorer

## About

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.

## Panels

### Ingress Headers

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.

### API Request Builder

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.

### Quick Actions

One-click buttons for commonly used API endpoints: status, config, states, services, and events.

## Configuration

This app has no configuration options. It uses `homeassistant_api: true` to access the Core API through Supervisor.
6 changes: 6 additions & 0 deletions api_explorer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ARG BUILD_FROM
FROM ${BUILD_FROM}

RUN pip3 install --no-cache-dir aiohttp==3.11.12

COPY rootfs /
20 changes: 20 additions & 0 deletions api_explorer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# API Explorer

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.

## What it does

- **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.
- **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.
- **Quick Actions**: Preset buttons for common Core API endpoints like `/api/states`, `/api/config`, and `/api/services`.

## Usage

1. Copy this folder to `/addons/` on a Home Assistant OS or Supervised system
2. In the HA UI: Settings > Apps > App Store > reload
3. Find "API Explorer" in local apps, install and start
4. Open via the sidebar panel

## Architecture

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.
4 changes: 4 additions & 0 deletions api_explorer/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
build_from:
aarch64: ghcr.io/home-assistant/aarch64-base-python:3.13-alpine3.21
amd64: ghcr.io/home-assistant/amd64-base-python:3.13-alpine3.21
17 changes: 17 additions & 0 deletions api_explorer/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: API Explorer
version: "1.0.0"
slug: api_explorer
description: Inspect ingress headers and test Home Assistant Core API calls through Supervisor
url: https://www.home-assistant.io
arch:
- amd64
- aarch64
image: homeassistant/{arch}-app-api-explorer
ingress: true
ingress_port: 8099
panel_icon: mdi:api
panel_title: API Explorer
homeassistant_api: true
init: false
startup: application
boot: manual
Loading