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 with available credits.
Scanned 9/11/2026
Install to Claude Code
npx -y skills add lxyeternal/MalSkillBench --skill clawhub-aces1up-apify-keys__v1.0.0 --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Clawhub Aces1up Apify Keys V1.0.0?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/lxyeternal-clawhub-aces1up-apify-keys-v1-0-0)More formats (shields.io, HTML) on the badges page.
---
name: apify-keys
description: 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 with available credits.
---
# 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:**
```bash
python3 ~/.openclaw/workspace/skills/apify-keys/scripts/get_key.py
```
**Get key as JSON (for piping to other scripts):**
```bash
python3 ~/.openclaw/workspace/skills/apify-keys/scripts/get_key.py --json
```
**Check balance on a specific key:**
```bash
python3 ~/.openclaw/workspace/skills/apify-keys/scripts/get_key.py --check-balance --key "apify_api_xxxxx"
```
**List all available keys with balances:**
```bash
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`):**
```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:
```bash
APIFY_KEY=$(python3 ~/.openclaw/workspace/skills/apify-keys/scripts/get_key.py)
# Then use $APIFY_KEY in your API calls
```
Or in Python:
```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"]
```
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!