← 返回 Skills 市场
yinanping-cpu

Api Integrator

作者 Yinanping · GitHub ↗ · v1.0.1
cross-platform ✓ 安全检测通过
484
总下载
0
收藏
5
当前安装
2
版本数
在 OpenClaw 中安装
/install yinan-api-integrator
功能描述
API integration and automation skill for connecting services, webhooks, and third-party platforms. Use when integrating APIs, building webhooks, syncing data...
使用说明 (SKILL.md)

API Integrator

Overview

Professional API integration skill for OpenClaw. Connect and automate workflows between multiple services, handle authentication, manage rate limits, and build custom API clients.

Features

  • REST API testing
  • OAuth 2.0/Bearer/Basic auth support
  • API client code generation (Python/JavaScript)
  • Rate limit handling
  • Auto-retry on 429

Quick Start

Test API Endpoint

python scripts/api_client.py --action test --url "https://api.example.com/users" --method GET --auth bearer --token YOUR_TOKEN

Generate API Client

python scripts/api_client.py --action create-client --name myapi --base-url "https://api.example.com" --language python

Scripts

api_client.py

Test APIs and generate client code.

Actions:

  • test - Test API endpoint
  • create-client - Generate API client code
  • webhook-test - Test webhook receiver

Arguments:

  • --action - Action to perform
  • --url - API endpoint URL
  • --method - HTTP method
  • --auth - Authentication type (none, bearer, basic, api_key)
  • --token - Auth token/API key
  • --name - Client name (for create-client)
  • --base-url - API base URL
  • --language - Output language (python, javascript)
  • --output - Output file path

Authentication Methods

API Key

headers = {
    "X-API-Key": "your_api_key"
}

Bearer Token

headers = {
    "Authorization": f"Bearer {access_token}"
}

OAuth 2.0

# Get access token
token_url = "https://auth.example.com/oauth/token"
data = {
    "grant_type": "client_credentials",
    "client_id": CLIENT_ID,
    "client_secret": CLIENT_SECRET
}
response = requests.post(token_url, data=data)
access_token = response.json()["access_token"]

Basic Auth

import base64
credentials = base64.b64encode(f"{username}:{password}".encode()).decode()
headers = {
    "Authorization": f"Basic {credentials}"
}

Common Integrations

E-commerce Platforms

Platform API Docs Auth Type
Taobao https://open.taobao.com OAuth 2.0
Douyin https://open.douyin.com OAuth 2.0
Shopify https://shopify.dev/api API Key
WooCommerce https://woocommerce.github.io OAuth 1.0a

Payment Processors

Platform API Docs Auth Type
Stripe https://stripe.com/docs/api Bearer Token
PayPal https://developer.paypal.com OAuth 2.0
Alipay https://opendocs.alipay.com RSA Key

Communication

Platform API Docs Auth Type
SendGrid https://docs.sendgrid.com Bearer Token
Twilio https://www.twilio.com/docs Basic Auth
Slack https://api.slack.com Bearer Token

Rate Limiting

Built-in Rate Limit Handling

python scripts/sync_data.py \
  --source stripe \
  --target shopify \
  --rate-limit 100/minute \
  --retry-on-429 true

Rate Limit Strategies

  • Fixed window: N requests per minute
  • Sliding window: Smooth distribution
  • Token bucket: Burst allowance
  • Exponential backoff: Retry with increasing delays

Error Handling

Common HTTP Errors

Code Meaning Action
400 Bad Request Fix request parameters
401 Unauthorized Check authentication
403 Forbidden Check permissions
404 Not Found Verify endpoint/ID
429 Too Many Requests Wait and retry
500 Server Error Retry with backoff
503 Service Unavailable Retry later

Retry Logic

import time
from requests.exceptions import RequestException

def api_request_with_retry(url, max_retries=3):
    for attempt in range(max_retries):
        try:
            response = requests.get(url)
            response.raise_for_status()
            return response.json()
        except RequestException as e:
            if attempt == max_retries - 1:
                raise
            wait_time = 2 ** attempt  # Exponential backoff
            time.sleep(wait_time)

Best Practices

  1. Use environment variables for API keys and secrets
  2. Implement rate limiting to avoid API bans
  3. Cache responses when appropriate
  4. Log all API calls for debugging
  5. Handle errors gracefully with retries
  6. Validate responses before processing
  7. Use webhooks instead of polling when possible

Security

  • Never commit API keys to version control
  • Use HTTPS for all API calls
  • Rotate keys periodically
  • Implement request signing for webhooks
  • Validate webhook signatures

Troubleshooting

  • 401 Unauthorized: Check token expiration, refresh if needed
  • 403 Forbidden: Verify API permissions and scopes
  • 429 Rate Limited: Implement backoff, reduce request frequency
  • Timeout errors: Increase timeout, add retries
  • Invalid response: Check API version, validate schema
安全使用建议
This skill appears to do what it says: make HTTP requests, test webhooks, and generate simple client code. Before using it: (1) review the full scripts yourself (or run in a sandbox) because the tool makes arbitrary network requests; (2) never supply production credentials to unknown third-party code — use throwaway/test credentials when exercising endpoints; (3) be aware logs and printed responses may contain sensitive data returned by APIs (tokens, user data) so avoid testing against endpoints that echo secrets; (4) confirm the truncated file in the provided manifest (the pasted script appears cut off) — fetch the complete source if you plan to rely on it in production.
功能分析
Type: OpenClaw Skill Name: yinan-api-integrator Version: 1.0.1 The skill is a legitimate API integration utility designed for testing REST endpoints and generating boilerplate client code in Python and JavaScript. Analysis of `scripts/api_client.py` reveals standard use of the `requests` library for HTTP communication, including appropriate handling of authentication and rate limiting (429 status codes). No evidence of data exfiltration, malicious execution, obfuscation, or prompt injection was found in the code or documentation.
能力评估
Purpose & Capability
Name/description align with the included SKILL.md and scripts: the Python script implements endpoint testing, client generation, and basic auth/OAuth examples consistent with an API integrator. There are no unexpected dependencies, binaries, or config paths required.
Instruction Scope
SKILL.md restricts behavior to API testing, client generation, rate-limit handling and webhook testing. It advises using environment variables for credentials but does not instruct reading arbitrary local files. Note: the script logs requests/responses and printed logs could expose tokens or sensitive responses if those are returned by an API; be careful when testing endpoints that echo secrets.
Install Mechanism
No install spec; this is instruction-plus-script only. No downloads or archive extraction are performed by the skill itself, minimizing install-time risk.
Credentials
The skill declares no required environment variables or credentials. The SKILL.md and script demonstrate how to use common credentials (tokens, client_id/secret) but do not require or attempt to access unrelated secrets or services.
Persistence & Privilege
The skill is not always-enabled and does not request elevated persistence or modify other skills. It runs on demand and contains no code that writes persistent agent-level configuration.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install yinan-api-integrator
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /yinan-api-integrator 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
- Introduced a new README.md to provide clearer project documentation. - Consolidated scripts into a unified api_client.py for both API testing and client code generation. - Simplified and streamlined feature list and usage instructions. - Updated usage examples and arguments to reflect changes in script names and options. - Retained detailed authentication, integration, and error handling sections for continuity.
v1.0.0
Initial release of yinan-api-integrator. - Provides scripts to integrate and automate APIs (REST, GraphQL), manage authentication (API key, OAuth2, etc.), and webhooks. - Includes tools for testing API endpoints, creating custom API clients, setting up webhook receivers, and syncing data between APIs. - Supports rate limit handling, auto-retry, and response caching. - Documentation includes usage examples, common authentication patterns, integrations for e-commerce, payments, and communication platforms. - Covers error handling strategies, retry logic, best practices, and troubleshooting guidance for robust API workflows.
元数据
Slug yinan-api-integrator
版本 1.0.1
许可证
累计安装 5
当前安装数 5
历史版本数 2
常见问题

Api Integrator 是什么?

API integration and automation skill for connecting services, webhooks, and third-party platforms. Use when integrating APIs, building webhooks, syncing data... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 484 次。

如何安装 Api Integrator?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install yinan-api-integrator」即可一键安装,无需额外配置。

Api Integrator 是免费的吗?

是的,Api Integrator 完全免费(开源免费),可自由下载、安装和使用。

Api Integrator 支持哪些平台?

Api Integrator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Api Integrator?

由 Yinanping(@yinanping-cpu)开发并维护,当前版本 v1.0.1。

💬 留言讨论