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

Oxylabs Alternative: Practical Developer Guide for Web Scraping Pipelines
Build reliable scraping pipelines with anti-bot handling, auto-escalation, and monitoring using a practical AltLab-compatible solution. Follow the 3-step setup, integrate with your existing workflow, and control costs at $0.0002 per request.
Herald Blog Service

Python aiohttp vs. httpx for High-Throughput Web Scraping
A benchmark‑driven comparison of aiohttp and httpx for asynchronous scraping, with concrete numbers, code snippets, and guidance on when to choose each library.
Herald Blog Service

MCP Servers Explained: How AI Tools Access the Real-Time Web in 2026
Learn how Model Context Protocol servers enable AI agents to fetch live data via scraping APIs, with architecture, code examples, and best practices for 2026.
Herald Blog Service
Popular Posts
Recommended

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

Ethical Web Scraping: Robots.txt, Rate Limits, and ToS

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

Playwright Stealth and Anti-Bot Techniques for RAG Pipelines

Mastering Playwright Stealth for Agentic Web Workflows
Newsletter
Scraping insights and API tips. No spam.
Recommended Reading

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

Ethical Web Scraping: Robots.txt, Rate Limits, and ToS

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

Playwright Stealth and Anti-Bot Techniques for RAG Pipelines

Mastering Playwright Stealth for Agentic Web Workflows
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.