← 返回
未分类 中文

Smart API Connector

Connect to any REST API using the agent's built-in web_fetch. Handles authentication headers, JSON payloads, error parsing, and retries. Use when: user wants...
使用代理内置的 web_fetch 连接到任意 REST API,自动处理认证头、JSON 请求体、错误解析和重试。适用场景:用户想要...
tommot2
未分类 clawhub v3.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 556
下载
💾 0
安装
1
版本
#api#automation#connector#developer#http#integration#json#latest#requests#rest

概述

Smart API Connector v3.0

Install: clawhub install smart-api-connector

REST API integration using built-in tools. No code, no curl, no dependencies.

Language

Detect from user's message language. Default: English.

Quick Start

User provides: API URL + what they want. Agent handles everything.

> User: "Hent brukerinfo fra https://api.example.com/v1/users/123"

>

> Agent runs: web_fetch https://api.example.com/v1/users/123 (with auth headers if provided)

>

> Returns parsed response.

Authentication

API Key in Header

web_fetch url --headers '{"Authorization": "Bearer KEY", "X-API-Key": "KEY"}'

API Key via Environment Variable

exec: API_KEY="your_key" curl -s -H "Authorization: Bearer $API_KEY" "https://..."

Session-only Keys

API keys provided in conversation are used in-session only. Never persisted to files.

Error Handling

HTTP StatusAction
---------------------
200-299Parse and return response
429Rate limited — wait and retry (max 3 retries)
400Bad request — show error, suggest fix
401/403Auth failed — check key, permissions
404Not found — verify URL
5xxServer error — retry once, then report

HTTP Methods

MethodUse Case
------------------
GETFetch data
POSTCreate data / send JSON body
PUTUpdate data
DELETERemove data

For POST/PUT: prompt user for JSON body if not provided.

Response Parsing

Always extract and present the useful parts. For JSON APIs:

Response:
  Name: John
  Email: john@example.com
  Created: 2026-03-28

Raw: {first 200 chars if user wants detail}

Security

  • Keys are session-only — never written to files
  • Prefer environment variables over command-line args
  • Scoped/test keys over production secrets
  • Show user the exact request before executing (URL + method + headers, not the key value)

Quick Commands

User saysAction
-------------------
"query {url}"GET request
"POST to {url}"POST with body
"test API {url}"Request + show response
"API health check"GET and report status

Guidelines for Agent

  1. Use web_fetch first — built-in, no dependencies
  2. Fall back to exec/curl only if web_fetch can't handle the request
  3. Never persist API keys — session only
  4. Show request before executing — confirm with user for POST/PUT/DELETE
  5. Parse responses — extract useful data, don't dump raw JSON
  6. Handle errors gracefully — retry on 429, explain 401/403
  7. Match user language in responses

What This Skill Does NOT Do

  • Does NOT persist API keys or credentials
  • Does NOT require npm packages or external tools
  • Does NOT modify any local files
  • Does NOT make requests without user knowledge (for POST/PUT/DELETE)

More by TommoT2

  • workflow-builder-lite — Build and execute multi-step workflows
  • context-brief — Persistent context survival across sessions
  • setup-doctor — Diagnose and fix OpenClaw setup issues

Install the full suite:

clawhub install smart-api-connector workflow-builder-lite context-brief setup-doctor

版本历史

共 1 个版本

  • v3.0.0 当前
    2026-05-03 04:57 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

suspicious
查看报告

🔗 相关推荐

Context Brief

tommot2
Persistent context survival for OpenClaw. Writes file-based anchors to memory/anchors/ to preserve critical context acro
★ 0 📥 616

Skill Analytics

tommot2
使用文件状态跟踪监控 ClawHub 技能性能;通过 web_fetch拉取公开统计,跟踪推荐及其结果,避免重复。
★ 1 📥 541

Workflow Builder Lite

tommot2
构建并执行带条件逻辑的多步工作流,将 API 调用、代理动作和 shell 命令链接为序列,并支持 if/else 分支。
★ 0 📥 612