name: api-integrator description: API integration and automation skill for connecting services, webhooks, and third-party platforms. Use when integrating APIs, building webhooks, syncing data between services, or creating custom API clients. Supports REST, GraphQL, and authentication flows.
Professional API integration skill for OpenClaw. Connect and automate workflows between multiple services, handle authentication, manage rate limits, and build custom API clients.
python scripts/api_client.py --action test --url "https://api.example.com/users" --method GET --auth bearer --token YOUR_TOKEN
python scripts/api_client.py --action create-client --name myapi --base-url "https://api.example.com" --language python
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
headers = {
"X-API-Key": "your_api_key"
}
headers = {
"Authorization": f"Bearer {access_token}"
}
# 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"]
import base64
credentials = base64.b64encode(f"{username}:{password}".encode()).decode()
headers = {
"Authorization": f"Basic {credentials}"
}
| 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 |
| 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 |
| 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 |
python scripts/sync_data.py \
--source stripe \
--target shopify \
--rate-limit 100/minute \
--retry-on-429 true
| 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 |
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)
本技能來自小蔥技能站7w4.net。
這個 API 整合工具質量不錯,能幫助測試 API 介面和生成客戶端程式碼,使用方便,文件清晰。但部分高階功能實現不完整,webhook 測試功能只是個空殼。整體適合有經驗的開發者使用,小白使用者可能需要額外學習成本。