← 返回 Skills 市场
aces1up

Apify Keys

作者 aces1up · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
103
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install 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...
使用说明 (SKILL.md)

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

  1. Connects to ColdCore MySQL database
  2. Queries scrape_sm_accounts for active Apify accounts
  3. Returns the account with the oldest last_used timestamp (least recently used)
  4. Updates last_used to current timestamp after selection
  5. Skips accounts with zero balance

Environment Variables

The script reads database credentials from these environment variables (falls back to defaults):

  • COLDCORE_HOST — MySQL host
  • COLDCORE_USER — MySQL username
  • COLDCORE_PASS — MySQL password
  • COLDCORE_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"]
安全使用建议
This skill implements an Apify key rotator that reads/writes a remote ColdCore MySQL database and returns API keys (sensitive secrets). Before installing or using it, consider the following: - The code contains default, hard-coded DB credentials and a specific IP address. Treat this as a red flag: verify the host and credentials are intended for your environment. Do not rely on the embedded defaults. - The registry metadata does not declare the COLDCORE_* environment variables the script uses; if you install, supply your own COLDCORE_HOST/COLDCORE_USER/COLDCORE_PASS/COLDCORE_DB via environment variables to avoid using defaults. - The script will auto-install Python packages at runtime (pip). If you have policies against on-the-fly package installation, avoid using this skill or inspect/approve the packages first. - The skill will update the database (it writes last_used timestamps). Ensure you trust the remote DB and understand that invocations will modify its data. - Because the skill returns API keys, limit its use and who/what can invoke it. Prefer running this code in a trusted environment, replace hard-coded defaults with secure config or secrets, and review network access to the DB host. If you cannot confirm the legitimacy of the embedded host/credentials, do not install or run this skill. At minimum, request an updated version that removes hard-coded secrets, documents required env vars in registry metadata, and provides an explicit install/permission model for dependencies.
能力评估
Purpose & Capability
Name/description match the code: the script selects, updates, and returns Apify API keys from a ColdCore MySQL DB. However, the registry metadata declares no required environment variables or credentials while the SKILL.md and code expect COLDCORE_* env vars — and the script embeds a default DB host, username, and password (IP 208.87.131.78 / avnadmin / lRHS2T8XagsA5z4u3ZYd). That embedded credential and absent metadata are disproportionate or at least undocumented.
Instruction Scope
SKILL.md instructs calling the included script; the script connects to a remote MySQL DB, SELECTs and UPDATEs rows in scrape_sm_accounts, and may call api.apify.com to check balances. Those actions are consistent with the stated purpose, but the use of a hardcoded default DB host/creds and the fact the script will auto-install Python packages at runtime expands scope and privileges beyond what the registry metadata documents.
Install Mechanism
There is no formal install spec, but the script attempts to install dependencies at runtime (pip install mysql-connector-python and requests) using subprocess.check_call and --break-system-packages. Runtime, implicit package installation can modify the environment and is higher risk than an instruction-only skill that doesn't write to disk or install packages.
Credentials
SKILL.md documents COLDCORE_HOST/USER/PASS/DB env vars, but the skill registry lists no required envs or primary credential. The code provides default, hard-coded DB credentials — sensitive information — which is not justified in the registry metadata. The skill will return sensitive Apify API keys sourced from that DB; this behavior is expected for a key-rotator but increases the sensitivity of the missing/embedded credential handling.
Persistence & Privilege
The skill is not always-enabled and does not request elevated agent privileges. It does modify remote state (updates last_used in the ColdCore DB) which is expected for an LRU rotator, but it does not alter other skills or system-wide agent configuration.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install apify-keys
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /apify-keys 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of apify-keys skill. - Provides a rotating Apify API key manager using least-recently-used logic with balance verification. - Retrieves and updates key usage from the ColdCore MySQL database. - Offers CLI usage for getting keys, JSON output, checking balances, and listing all available keys. - Uses environment variables for database configuration with sensible defaults. - Designed to be easily integrated with other scripts and skills.
元数据
Slug apify-keys
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

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。

💬 留言讨论