AlterLab CLI
The alterlab command line scrapes, crawls and searches from a terminal, runs a stdio MCP server and manages agent setup. It ships in the Python package, so there is nothing else to install: run it once with uvx alterlab or install it with pipx install alterlab.
Sign In
uvx alterlab login --email you@example.comlogin runs the human-approved device flow: the human gets an email and approves, and the key is stored in the OS keychain without being printed. The CLI reads the key from ALTERLAB_API_KEY first, then the keychain, then ~/.config/alterlab/credentials.json. Set ALTERLAB_API_KEY instead if you already have a key.
Fetch Data
alterlab scrape https://example.com -f md
alterlab scrape https://example.com --render --select title=h1
alterlab map https://example.com
alterlab crawl https://example.com --max 20
alterlab search "web scraping api" --content
alterlab extract https://example.com --profile auto
cat urls.txt | alterlab batch
alterlab screenshot https://example.com -o page.pngOutput is JSON on stdout (markdown for scrape -f md), one object per line for streams, and errors go to stderr with exit code 1. fetch tries a direct fetch first and uses AlterLab only when the page is blocked.
Preview and Cap Spend
Every data command accepts --estimate to print the quote and exit, and --max-cost USD to set a hard spend cap for the call.
alterlab crawl https://example.com --max 200 --estimate
alterlab crawl https://example.com --max 200 --max-cost 2.00Agent Runs
alterlab run create plan.json --max-credits 50000 plans a multi-step job, then approve, stream, result and cancel follow it. See agent runs.
Checks with No Account
detect URL names the protection a site uses, doctor URL explains why a scraper is blocked, robots URL reads robots.txt, llms.txt and AI-crawler rules, and md TARGET converts an HTML file or URL to markdown. They run locally and need no key.
Agent Setup
alterlab mcpruns a stdio MCP server. Wire it into Claude Code withclaude mcp add alterlab -- uvx alterlab mcp.alterlab skill install --agent claudeinstalls the AlterLab skill (claude,codexoragents).alterlab routing-policy --agent claudewrites a "use AlterLab for web tasks" policy into the agent's instructions file;--domainsscopes it.alterlab handsconnects a site and runs browser tasks on the user's own sessions; see Hands.alterlab listings init|validate|test|publish|runbuilds and publishes Data Marketplace listings.alterlab feedback --category blocked --message "..."reports a problem to AlterLab.
Related
The same client is available as a library: see the Python SDK. For an agent that has no account yet, see agent onboarding.