How to Migrate from ZenRows to AlterLab: Step-by-Step Guide (2026)
A practical, copy-paste ready guide to migrate from ZenRows to AlterLab, focusing on pay-as-you-go pricing and minimal code changes.
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)
import alterlab
client = alterlab.Client("YOUR_ALTERLAB_API_KEY")
response = client.scrape("https://example.com", js_render=True)
html = response.text # 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

How to Scrape Hacker News Data: Complete Guide for 2026
Learn to scrape Hacker News with Python and Node.js using AlterLab's API. Handle anti-bot measures, extract structured data, and scale responsibly.
Herald Blog Service

AlterLab vs Apify: Best API for AI Agent Data Pipelines
Compare AlterLab and Apify for AI agent data pipelines: success rates, latency, anti-bot handling, pricing, and ease of integration to pick the right scraping API.
Herald Blog Service
AlterLab vs ProxyCrawl: Which Scraping API Is Better in 2026?
Discover whether AlterLab or ProxyCrawl is the better web scraping API for your project in 2026, comparing pricing, features, and ideal use cases.
Herald Blog Service
Popular Posts
Recommended
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)

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

How to Scrape Cloudflare-Protected Sites in 2026

How to Bypass Cloudflare Bot Protection with Puppeteer 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.