
How to Migrate from ScraperBox to AlterLab: Step-by-Step Guide (2026)
Learn how to switch from ScraperBox to AlterLab in under an hour with pay-as-you-go pricing, no subscriptions, and minimal code changes.
AlterLab handles this automatically — scrape any URL with one API call. No infrastructure required.
Try it freeBoth APIs are capable — this guide is for developers prioritizing pay-as-you-go pricing and no subscription requirements.
TL;DR
To migrate from ScraperBox to AlterLab, sign up for a free AlterLab account, install the AlterLab Python SDK, replace your ScraperBox client calls with alterlab.Client, and update your API key. The response format is largely unchanged, so most of your existing code works without modification.
Why migrate?
ScraperBox uses monthly subscription plans with separate pricing for JavaScript rendering add-ons, which can increase costs unpredictably. AlterLab eliminates subscriptions, charges a flat pay-as-you-go rate, and includes JavaScript rendering in the base price, giving you predictable costs and no wasted balance.
Prerequisites
- An AlterLab account (create one for free at /signup)
- Your AlterLab API key (found in the dashboard)
- About 5 minutes of time
Step 1: Install the AlterLab SDK
If you prefer using the official Python SDK, install it with pip. You can also call the REST API directly, but the SDK simplifies authentication and retries.
pip install alterlabFor more details, see the Getting started guide.
Step 2: Replace your API calls
Below is a side‑by‑side comparison of a typical ScraperBox request and the equivalent AlterLab call. The only changes are the import, client initialization, and the API key.
# ScraperBox (before migration)
import requests
TOKEN = "YOUR_SCRAPERBOX_TOKEN"
url = "https://example.com"
response = requests.get(
"https://api.scraperbox.com/scrape",
params={"token": TOKEN, "url": url, "use_browser": True}
)
html = response.text# AlterLab (after migration)
import alterlab
client = alterlab.Client("YOUR_ALTERLAB_API_KEY")
response = client.scrape("https://example.com", use_browser=True)
html = response.text # Same data, pay-as-you-go pricingIf you are using the raw REST endpoint, replace the base URL and token name:
import requests
ALTERLAB_TOKEN = "YOUR_ALTERLAB_API_KEY"
url = "https://example.com"
response = requests.get(
"https://api.alterlab.io/v1/scrape",
params={"token": ALTERLAB_TOKEN, "url": url, "use_browser": True}
)
html = response.textStep 3: Handle response format differences
AlterLab returns a JSON object with the same top‑level fields as ScraperBox: text (or html), status_code, and headers. The only difference is that AlterLab nests error details under an error key when status_code is not 200, whereas ScraperBox returned a plain error body. Check response.status_code before accessing response.text.
if response.status_code == 200:
html = response.text
else:
# AlterLab returns structured error info
print(f"Error {response.status_code}: {response.json().get('error')}")Step 4: Update your error handling
Both services use HTTP status codes to signal problems. AlterLab uses 429 for rate limiting and 402 for insufficient balance. Your existing retry logic based on status codes will work unchanged; just ensure you treat 402 as a signal to top up your balance rather than an authentication error.
import time
import alterlab
client = alterlab.Client("YOUR_ALTERLAB_API_KEY")
max_retries = 3
for attempt in range(max_retries):
response = client.scrape("https://example.com")
if response.status_code == 200:
break
if response.status_code == 429:
time.sleep(2 ** attempt) # exponential backoff
elif response.status_code == 402:
raise Exception("Insufficient AlterLab balance")
else:
raise Exception(f"Request failed: {response.status_code}")Cost comparison
Consider a scenario of 10,000 requests per month with JavaScript rendering enabled.
- AlterLab: 10,000 × $0.0002 = $2.00 per month, no subscription, balance never expires.
- ScraperBox (based on public pricing): $20 monthly subscription + $0.001 per request for JavaScript rendering = $20 + (10,000 × $0.001) = $30 per month.
See the full breakdown on the AlterLab pricing page.
Common issues and fixes
- Missing
use_browserparameter: AlterLab defaults tofalse. Adduse_browser=Truefor sites that require JavaScript. - API key environment variable: If you stored your ScraperBox token in
SCRAPERBOX_TOKEN, rename it toALTERLAB_API_KEYor update your code to read the new variable. - Response encoding: AlterLab always returns UTF‑8 text. If you relied on ScraperBox’s automatic encoding detection, explicitly decode with
response.text.encode('utf-8')if needed. - Rate limit headers: AlterLab sends
X-RateLimit-RemainingandX-RateLimit-Reset. Adjust any logic that scraped these headers from ScraperBox.
You're done
Your migration is complete. Run your test suite to confirm everything works, then deploy. For more advanced features like scheduling, webhooks, or Cortex AI extraction, refer to the documentation. If you hit any snags, hit reply if you have questions.
AlterLab // Web Data, Simplified.
Was this article helpful?
Frequently Asked Questions
Related Articles

TechCrunch Data API: Extract Structured JSON in 2026
Learn how to build a robust data pipeline to get structured TechCrunch data via API. Use AlterLab's Extract API to turn raw HTML into typed JSON instantly.
Herald Blog Service

How to Scrape Nordstrom Data: Complete Guide for 2026
Learn how to scrape Nordstrom data efficiently using Python and Node.js. This guide covers handling anti-bot protections and using AI-powered extraction.
Herald Blog Service

How to Scrape Zara Data: Complete Guide for 2026
A practical guide to scraping Zara's public product data using AlterLab's API with Python and Node.js, handling anti-bot measures and extracting structured JSON.
Herald Blog Service
Popular Posts
Recommended

How to Scrape AliExpress: Complete Guide for 2026

Why Your Headless Browser Gets Detected (and How to Fix It)

AlterLab vs Firecrawl: In-Depth Review with Benchmarks & Code Examples

How to Scrape Twitter/X Data: Complete Guide for 2026

How to Scrape Cloudflare-Protected Sites in 2026
Newsletter
Scraping insights and API tips. No spam.
Recommended Reading

How to Scrape AliExpress: Complete Guide for 2026

Why Your Headless Browser Gets Detected (and How to Fix It)

AlterLab vs Firecrawl: In-Depth Review with Benchmarks & Code Examples

How to Scrape Twitter/X Data: Complete Guide for 2026

How to Scrape Cloudflare-Protected Sites in 2026
Stay in the Loop
Get scraping insights, API tips, and platform updates. No spam — we only send when we have something worth reading.
Explore AlterLab
Anti-Bot Handling API
Automatic challenge handling for protected sites — works out of the box.
JavaScript Rendering API
Render SPAs and dynamic content with headless Chromium.
Pricing
5-tier pricing from $0.0002/page. 5,000 free requests to start.
Documentation
API reference, SDKs, quickstart guides, and tutorials.
Web Scraping API Resources
Part of the Web Scraping API Documentation cluster
Complete API reference with 5-tier auto-escalation — Curl to challenge resolution.
Pillar pageConfigure Tier 4 browser rendering for SPAs and dynamic content.
Scrape pages behind login using session management.
Real success rates and cost data across all 5 tiers.
MCP Server, Python SDK, and Firecrawl-compatible API for AI agent workflows.