← 返回
未分类 中文

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...
轮换 Apify API 密钥管理器。从 ColdCore 数据库返回最近最少使用的有效 Apify 密钥。在任何 Apify API 调用前使用,以获取新的密钥...
aces1up
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 331
下载
💾 0
安装
1
版本
#latest

概述

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": "user@example.com", "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"]

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 13:22 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

X-Scout

aces1up
X/Twitter 情报爬虫。搜索推文、抓取用户资料、提取评论、自动转录视频。将推文分类为可复现方法与普通内容。命令行界面...
★ 0 📥 591
business-ops

RedditRank

aces1up
找出在谷歌首页排名的Reddit帖子,AI自动生成自然提及您产品的上下文回复,复制粘贴即可发布。
★ 0 📥 506

Ad Engine

aces1up
从Supabase组件组装模块化广告,通过营销API部署到Facebook广告管理器。支持预览、单个/批量部署和状态追踪。
★ 0 📥 377