/install apify-keys
Apify Key Rotator
Get a rotating Apify API key from the ColdCore database. Keys are rotated by least-recently-used with balance checking.
Usage
Get next available API key:
python3 ~/.openclaw/workspace/skills/apify-keys/scripts/get_key.py
Get key as JSON (for piping to other scripts):
python3 ~/.openclaw/workspace/skills/apify-keys/scripts/get_key.py --json
Check balance on a specific key:
python3 ~/.openclaw/workspace/skills/apify-keys/scripts/get_key.py --check-balance --key "apify_api_xxxxx"
List all available keys with balances:
python3 ~/.openclaw/workspace/skills/apify-keys/scripts/get_key.py --list
How It Works
- Connects to ColdCore MySQL database
- Queries
scrape_sm_accountsfor active Apify accounts - Returns the account with the oldest
last_usedtimestamp (least recently used) - Updates
last_usedto current timestamp after selection - Skips accounts with zero balance
Environment Variables
The script reads database credentials from these environment variables (falls back to defaults):
COLDCORE_HOST— MySQL hostCOLDCORE_USER— MySQL usernameCOLDCORE_PASS— MySQL passwordCOLDCORE_DB— Database name (default:lead_generator)
Output
Default mode: prints just the API key string (for easy piping)
apify_api_xxxxx
JSON mode (--json):
{"id": 68, "api_key": "apify_api_xxxxx", "email": "[email protected]", "balance": 4.95}
Integration with Other Skills
Other skills that need Apify access should call this script to get a key:
APIFY_KEY=$(python3 ~/.openclaw/workspace/skills/apify-keys/scripts/get_key.py)
# Then use $APIFY_KEY in your API calls
Or in Python:
import subprocess
result = subprocess.run(
["python3", os.path.expanduser("~/.openclaw/workspace/skills/apify-keys/scripts/get_key.py"), "--json"],
capture_output=True, text=True
)
key_data = json.loads(result.stdout)
api_key = key_data["api_key"]
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install apify-keys - 安装完成后,直接呼叫该 Skill 的名称或使用
/apify-keys触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Apify Keys 是什么?
Rotating Apify API key manager. Returns the least-recently-used active Apify key from the ColdCore database. Use before any Apify API call to get a fresh key... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 103 次。
如何安装 Apify Keys?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install apify-keys」即可一键安装,无需额外配置。
Apify Keys 是免费的吗?
是的,Apify Keys 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Apify Keys 支持哪些平台?
Apify Keys 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Apify Keys?
由 aces1up(@aces1up)开发并维护,当前版本 v1.0.0。