/install gettangemperors
Tang Emperors API
Overview
This skill provides integration with a local backend API that returns information about the first three emperors of the Tang Dynasty (唐朝前3代皇帝). The API is deployed locally at http://127.0.0.1:8080 with the endpoint GET /api/v1/test.
Quick Start
Fetch Tang Dynasty emperor information:
python3 scripts/get_tang_emperors.py
Output formatted as human-readable text:
python3 scripts/get_tang_emperors.py
Output raw JSON:
python3 scripts/get_tang_emperors.py --json
API Details
- Base URL:
http://127.0.0.1:8080 - Endpoint:
/api/v1/test - Method: GET
- Returns: JSON data about the first three Tang Dynasty emperors
Error Handling
The script includes comprehensive error handling:
- Connection errors: Backend not running or unreachable
- Timeout errors: API response timeout (10s default)
- HTTP errors: Invalid HTTP responses (404, 500, etc.)
- JSON parsing errors: Malformed response data
- Unexpected errors: Other runtime errors
Usage Patterns
Direct API call:
curl http://127.0.0.1:8080/api/v1/test
Via Python script (recommended):
python3 scripts/get_tang_emperors.py
Programmatic access in Python:
from scripts.get_tang_emperors import get_tang_emperors, format_emperor_data
data = get_tang_emperors()
formatted = format_emperor_data(data)
print(formatted)
Resources
scripts/get_tang_emperors.py
Python client for the Tang Emperors API with:
get_tang_emperors(): Fetches raw JSON data from APIformat_emperor_data(): Formats data for human-readable output- CLI support with
--jsonflag for raw JSON output - Comprehensive error handling and timeout management
The script can be:
- Executed directly from command line
- Imported as a module in other Python code
- Used by Codex for automated API interactions
Notes
- Ensure the local backend is running before making API calls
- The API expects a GET request with no parameters
- Response format may vary; the script handles common patterns (list, dict with 'emperors' key, dict with 'data' key)
- Default timeout is 10 seconds; adjust in script if needed for your environment
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install gettangemperors - 安装完成后,直接呼叫该 Skill 的名称或使用
/gettangemperors触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
gettangemperors 是什么?
Query local backend API for Tang Dynasty emperor information. Use when user asks about Tang emperors, needs to fetch emperor data from local API, or referenc... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 241 次。
如何安装 gettangemperors?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install gettangemperors」即可一键安装,无需额外配置。
gettangemperors 是免费的吗?
是的,gettangemperors 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
gettangemperors 支持哪些平台?
gettangemperors 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 gettangemperors?
由 hzll(@hzlpypy)开发并维护,当前版本 v1.0.1。