API Catalog for Home Assistant
Reference skill for connecting external APIs and services to Home Assistant.
Overview
This skill covers authentication patterns and working code examples for connecting popular
APIs to Home Assistant via three methods:
- Node-RED - HTTP request node flows (fastest to get running)
- HA YAML -
rest sensor and rest_command (good for simple polling)
- Custom integration - Full HACS-publishable Python component (use
ha-integration skill)
The Iron Law
CREDENTIALS IN SECRETS - NEVER HARDCODED IN FLOWS OR YAML
API keys belong in Node-RED credentials, ESPHome secrets.yaml, or HA secrets.yaml.
Never paste real tokens into chat, flows that get exported, or YAML committed to git.
How to Use This Skill
- User mentions an API or service by name
- Read the relevant reference file for auth setup and endpoints
- Generate working code for the user's chosen method (Node-RED / YAML / integration)
- Include credential setup instructions
Reference Files
| Category |
File |
APIs Covered |
| Energy & electricity |
references/energy-apis.md |
Tibber, Nordpool, Energi Data Service |
| Weather |
references/weather-apis.md |
SMHI, OpenWeatherMap, yr.no, Tomorrow.io |
| Transport |
references/transport-apis.md |
SL, Trafikverket, Resrobot, Entur (NO) |
| Smart home clouds |
references/smarthome-apis.md |
Shelly Cloud, Tuya IoT, Philips Hue, IKEA Dirigera |
| Global / other |
references/global-apis.md |
OpenAI, Spotify, Google Calendar, Telegram, GitHub |
Authentication Patterns at a Glance
| Pattern |
How it works |
Examples |
| API key in header |
Authorization: Bearer {key} or X-API-Key: {key} |
Tibber, OpenAI |
| API key in URL |
?appid={key} appended to URL |
OpenWeatherMap |
| OAuth2 |
Get access token first, refresh periodically |
Spotify, Google |
| Local token |
One-time press-button auth on device |
Philips Hue |
| No auth |
Public API, no credentials needed |
SMHI, yr.no, Nordpool |
| Basic auth |
Username + password Base64-encoded |
Some local devices |
Output Methods
For each API, generate code for the method the user needs:
Node-RED: http request node + function node to parse + api-call-service to push to HA
HA YAML: rest sensor platform or rest_command under configuration.yaml
Full integration: Use ha-integration skill with the polling-integration template
Common Patterns
Node-RED: API key in header
{
"type": "http request",
"method": "GET",
"url": "https://api.example.com/data",
"headers": {"Authorization": "Bearer {{env.API_KEY}}"},
"ret": "obj"
}
Node-RED: GraphQL (Tibber-style)
{
"type": "http request",
"method": "POST",
"url": "https://api.tibber.com/v1-beta/gql",
"headers": {
"Authorization": "Bearer {{env.TIBBER_TOKEN}}",
"Content-Type": "application/json"
},
"payload": "{\"query\": \"{ viewer { homes { currentSubscription { priceInfo { current { total } } } } } }\"}",
"ret": "obj"
}
HA YAML: REST sensor
rest:
- scan_interval: 300
resource: https://api.example.com/current
headers:
Authorization: !secret example_api_key
sensor:
- name: "Example Value"
value_template: "{{ value_json.data.value }}"
unit_of_measurement: "°C"
Pre-Output Checklist
Integration
Pairs with:
node-red skill - for flow JSON implementation
ha-yaml skill - for YAML sensor and automation using the fetched data
ha-integration skill - for building a full HACS-publishable Python integration
1---2name: api-catalog3description: Reference guide for connecting popular APIs to Home Assistant via Node-RED, YAML, or custom integrations. Covers authentication, endpoints, and complete working examples for: energy APIs (Tibber, Nordpool), weather (SMHI, OpenWeatherMap, yr.no), transport (SL, Trafikverket, Resrobot), smart home clouds (Shelly, Tuya, Philips Hue, IKEA), and global APIs (OpenAI, Spotify, Google Calendar, Telegram, GitHub). Use this skill whenever the user mentions a specific external service, API, or data source they want to connect to Home Assistant - even if they don't say "API".4---56# API Catalog for Home Assistant78Reference skill for connecting external APIs and services to Home Assistant.910## Overview1112This skill covers authentication patterns and working code examples for connecting popular13APIs to Home Assistant via three methods:1415- **Node-RED** - HTTP request node flows (fastest to get running)16- **HA YAML** - `rest` sensor and `rest_command` (good for simple polling)17- **Custom integration** - Full HACS-publishable Python component (use `ha-integration` skill)1819## The Iron Law2021```22CREDENTIALS IN SECRETS - NEVER HARDCODED IN FLOWS OR YAML23```2425API keys belong in Node-RED credentials, ESPHome secrets.yaml, or HA `secrets.yaml`.26Never paste real tokens into chat, flows that get exported, or YAML committed to git.2728## How to Use This Skill29301. User mentions an API or service by name312. Read the relevant reference file for auth setup and endpoints323. Generate working code for the user's chosen method (Node-RED / YAML / integration)334. Include credential setup instructions3435## Reference Files3637| Category | File | APIs Covered |38|----------|------|-------------|39| Energy & electricity | `references/energy-apis.md` | Tibber, Nordpool, Energi Data Service |40| Weather | `references/weather-apis.md` | SMHI, OpenWeatherMap, yr.no, Tomorrow.io |41| Transport | `references/transport-apis.md` | SL, Trafikverket, Resrobot, Entur (NO) |42| Smart home clouds | `references/smarthome-apis.md` | Shelly Cloud, Tuya IoT, Philips Hue, IKEA Dirigera |43| Global / other | `references/global-apis.md` | OpenAI, Spotify, Google Calendar, Telegram, GitHub |4445## Authentication Patterns at a Glance4647| Pattern | How it works | Examples |48|---------|-------------|----------|49| API key in header | `Authorization: Bearer {key}` or `X-API-Key: {key}` | Tibber, OpenAI |50| API key in URL | `?appid={key}` appended to URL | OpenWeatherMap |51| OAuth2 | Get access token first, refresh periodically | Spotify, Google |52| Local token | One-time press-button auth on device | Philips Hue |53| No auth | Public API, no credentials needed | SMHI, yr.no, Nordpool |54| Basic auth | Username + password Base64-encoded | Some local devices |5556## Output Methods5758For each API, generate code for the method the user needs:5960**Node-RED:** `http request` node + `function` node to parse + `api-call-service` to push to HA61**HA YAML:** `rest` sensor platform or `rest_command` under `configuration.yaml`62**Full integration:** Use `ha-integration` skill with the `polling-integration` template6364## Common Patterns6566### Node-RED: API key in header67```json68{69 "type": "http request",70 "method": "GET",71 "url": "https://api.example.com/data",72 "headers": {"Authorization": "Bearer {{env.API_KEY}}"},73 "ret": "obj"74}75```7677### Node-RED: GraphQL (Tibber-style)78```json79{80 "type": "http request",81 "method": "POST",82 "url": "https://api.tibber.com/v1-beta/gql",83 "headers": {84 "Authorization": "Bearer {{env.TIBBER_TOKEN}}",85 "Content-Type": "application/json"86 },87 "payload": "{\"query\": \"{ viewer { homes { currentSubscription { priceInfo { current { total } } } } } }\"}",88 "ret": "obj"89}90```9192### HA YAML: REST sensor93```yaml94rest:95 - scan_interval: 30096 resource: https://api.example.com/current97 headers:98 Authorization: !secret example_api_key99 sensor:100 - name: "Example Value"101 value_template: "{{ value_json.data.value }}"102 unit_of_measurement: "°C"103```104105## Pre-Output Checklist106107- [ ] Credentials use `!secret` (YAML), Node-RED credentials, or env vars - never hardcoded108- [ ] Rate limits respected (include `scan_interval` or flow timer accordingly)109- [ ] Error handling included (Node-RED catch node or YAML timeout)110- [ ] For OAuth2: refresh token flow explained111- [ ] Attribution: which API endpoint, what data it returns112113## Integration114115**Pairs with:**116- `node-red` skill - for flow JSON implementation117- `ha-yaml` skill - for YAML sensor and automation using the fetched data118- `ha-integration` skill - for building a full HACS-publishable Python integration