X No-API Bot (Starter)
Safe starter for using X without official API.
What this does
login: saves browser session cookie/statefetch: read-only fetch from X search timelinepost: optional posting (disabled by default)
Setup
cd /home/openclaw/.openclaw/workspace/automations/x-no-api-bot
cp .env.example .env
npm install
npx playwright install chromium
1) Login once
npm run login
A browser opens. Log in to X manually, then press Enter in terminal.
2) Read-only fetch
npm run fetch
Outputs JSON and saves a log under logs/.
3) Optional posting (off by default)
Edit .env:
ENABLE_POSTING=true
Then draft a post:
npm run post -- "Hello from no-API automation"
Publish only with explicit confirm:
npm run post -- "Hello from no-API automation" --confirm
Cron (read-only)
Example every 30 min:
*/30 * * * * cd /home/openclaw/.openclaw/workspace/automations/x-no-api-bot && /usr/bin/npm run fetch >> logs/cron.log 2>&1
Notes
- UI can change and break selectors.
- Keep activity low-volume to reduce account risk.
- Prefer read-only monitoring unless you explicitly need posting.