How to Migrate from ZenRows to AlterLab: Step-by-Step Guide (2026)
How to Migrate from ZenRows to AlterLab: StepbyStep Guide 2026 TL;DR To migrate from ZenRows to AlterLab, install the AlterLab SDK, replace your ZenRows...
AlterLab handles this automatically — scrape any URL with one API call. No infrastructure required.
Try it freeTL;DR
To migrate from ZenRows to AlterLab, install the AlterLab SDK, replace your ZenRows client with alterlab.Client, update your API key, and keep the same request structure. The response format is nearly identical, so most of your scraping code remains unchanged.
Why migrate?
ZenRows uses a flat-rate subscription model where credits reset monthly, which can lead to wasted spend if you don’t use your full quota. AlterLab offers a pure pay‑as‑you-go model: you pay only for the requests you make, your balance never expires, and there are no monthly minimums. Both APIs are capable — this guide is for developers prioritizing pay-as-you-go pricing and no subscription requirements.
Prerequisites
- An AlterLab account (sign up free at [/signup])
- Your AlterLab API key (found in the dashboard)
- About 5 minutes to install the SDK and swap a few lines of code
Step 1: Install the AlterLab SDK
If you were using the ZenRows Python package, replace it with the AlterLab SDK. The install command is the same style.
pip install alterlabFor full setup details, see the Getting started guide.
Step 2: Replace your API calls
ZenRows and AlterLab share a similar REST API shape. Below is a direct before‑and‑after comparison.
# ZenRows (before migration)
from zenrows import ZenRowsClient
client = ZenRowsClient("YOUR_ZENROWS_API_KEY")
response = client.get("https://example.com", params={"js_render": true})
html = response.text# AlterLab (after migration)
from alterlab import AlterLabSync
client = AlterLabSync("YOUR_ALTERLAB_API_KEY")
response = client.scrape("https://example.com")
html = response["content"] # Same data, pay‑as‑you-go pricingIf you prefer to call the REST endpoint directly, the URL pattern is also compatible:
- ZenRows:
https://api.zenrows.com/v1/?apikey=KEY&url=URL&js_render=true - AlterLab:
https://api.alterlab.io/v1/?apikey=KEY&url=URL&js_render=true
Step 3: Handle response format differences
AlterLab returns a response object that mirrors ZenRows in the most common fields:
response.text– the raw HTML (or selected format)response.status_code– HTTP statusresponse.headers– response headers
The only notable difference is that AlterLab nests error details under response.error when status_code >= 400, whereas ZenRows includes them directly in the JSON body. For successful scrapes, you can treat the objects interchangeably.
Step 4: Update your error handling
Adjust any try/except blocks to check for AlterLab’s error structure.
try:
response = client.scrape(url)
if response.status_code != 200:
raise Exception(f"AlterLab error: {response.error}")
process(response.text)
except Exception as e:
# retry logic or alerting
logger.error(f"Scrape failed: {e}")Both libraries use standard HTTP status codes (429 for rate limiting, 5xx for server issues), so existing retry logic based on status codes works unchanged.
Cost comparison
To illustrate the financial impact, consider 10,000 scraping requests per month.
- AlterLab: 10,000 × $0.0002 = $2.00 per month. No subscription, no minimum spend, and unused balance carries over indefinitely.
- ZenRows: Their lowest flat‑rate plan is $49/month for 10,000 requests (≈ $0.0049/request). If you use fewer than 10,000 requests, you still pay the full $49; unused requests do not roll over.
See the latest pricing on the AlterLab pricing page for volume discounts and tier details.
Common issues and fixes
- Missing
js_renderflag – AlterLab uses the same parameter name as ZenRows (js_render=true). If you previously usedrender_js, rename it. - API key environment variable – Rename
ZENROWS_API_KEYtoALTERLAB_API_KEYin your.envor CI secrets. - Response encoding – AlterLab always returns UTF‑8 decoded text; if you relied on
response.contentfor binary data, useresponse.raw_contentinstead. - Rate‑limit headers – AlterLab sends
X-RateLimit-RemainingandX-RateLimit-Reset(same as ZenRows), so your throttling code needs no change.
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, visit the full 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

Akamai Bot Manager Sensor Checks: Technical Guide
Learn how Akamai Bot Manager sensor checks work, why requests fail, and how ethical scraping pipelines use browser execution, sessions, and tiered requests.
Herald Blog Service

Scheduling Recurring Scrapes with Python and Cron
Learn how to schedule recurring scrapes with Python and cron, choose safe intervals, prevent duplicate runs, handle failures, and build reliable data pipelines.
Herald Blog Service

Job Listing Aggregation with Web Scraping
Build job listing aggregation with web scraping. Learn source discovery, extraction, normalization, deduplication, and refresh design for data engineers.
Herald Blog Service
Popular Posts
Recommended

Selenium Bot Detection: Why You Get Flagged and How to Fix It

Understanding Anti-Bot Detection: Fingerprinting and Rate Limits

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

Mastering Playwright Stealth for Agentic Web Workflows

Playwright Bot Detection: What Actually Works in 2026
Newsletter
Scraping insights and API tips. No spam.
Recommended Reading

Selenium Bot Detection: Why You Get Flagged and How to Fix It

Understanding Anti-Bot Detection: Fingerprinting and Rate Limits

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

Mastering Playwright Stealth for Agentic Web Workflows

Playwright Bot Detection: What Actually Works 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. Up to 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.