How to Migrate from Crawlbase to AlterLab: Step-by-Step Guide (2026)
How to Migrate from Crawlbase to AlterLab: StepbyStep Guide 2026 TL;DR: To migrate from Crawlbase to AlterLab, install the alterlab SDK, replace your...
AlterLab handles this automatically — scrape any URL with one API call. No infrastructure required.
Try it freeTL;DR: To migrate from Crawlbase to AlterLab, install the alterlab SDK, replace your Crawlbase API endpoint/token with the AlterLab client, and use a single API key for both standard HTML and JavaScript-rendered pages.
Both APIs are capable — this guide is for developers prioritizing pay-as-you-go pricing and no subscription requirements.
Why migrate?
The primary driver for migrating from Crawlbase to AlterLab is the complexity of managing different token types. In Crawlbase, you must manage separate tokens for standard HTML scraping and JavaScript-heavy rendering. This lack of a unified SDK often leads to fragmented codebases and complicated logic to decide which token to use for a specific URL.
AlterLab unifies these into a single request. Whether you need a simple GET request or a heavy-duty browser-based scrape to bypass Cloudflare, you use the same client and the same balance. For a deeper technical breakdown of these differences, see our detailed Crawlbase comparison.
Prerequisites
Before starting, ensure you have:
- An AlterLab account (you can sign up for free here).
- Your AlterLab API key from the dashboard.
- Python 3.8+ or Node.js installed.
The migration typically takes less than 15 minutes for most production environments.
Step 1: Install the AlterLab SDK
While you can use requests or axios to hit our REST endpoint, we recommend using our official SDK for better type hinting and error handling.
pip install alterlabIf you are using Node.js, run:
npm install @alterlab/sdkFor more details on environment setup, check our getting started guide.
Step 2: Replace your API calls
The logic remains the same: you provide a URL, and AlterLab returns the content. The major difference is how you handle JavaScript rendering. In Crawlbase, you change the endpoint or the token. In AlterLab, you simply pass a parameter.
Here is how your code looks before and after the migration.
# Crawlbase implementation
import requests
CRAWLBASE_TOKEN = "your_crawlbase_token"
url_to_scrape = "https://example.com"
# For standard HTML
res = requests.get(f"https://api.crawlbase.com/?token={CRAWLBASE_TOKEN}&url={url_to_scrape}")
# For JS rendering (requires a different endpoint or token logic)
js_res = requests.get(f"https://api.crawlbase.com/render?token={CRAWLBASE_TOKEN}&url={url_to_scrape}")# AlterLab implementation
from alterlab import AlterLabSync
client = AlterLabSync("YOUR_ALTERLAB_API_KEY")
# Standard scrape
response = client.scrape("https://example.com")
# JS rendering (just add the parameter)
js_response = client.scrape("https://example.com")
print(response["content"])Step 3: Handle response format differences
AlterLab returns a standard response object. If you were previously parsing raw HTML from Crawlbase, your logic will work without modification.
If you use our Cortex AI feature to extract structured data, the transition is even simpler. Instead of parsing regex patterns from the HTML, you can pass a schema directly:
# Move from regex parsing to structured extraction
response = client.scrape(
"https://example.com/product",
extract={
"price": "string",
"availability": "boolean"
}
)
print(response.json()['price'])Step 4: Update your error handling
Crawlbase uses specific HTTP status codes for its service. AlterLab follows standard REST patterns. Most importantly, AlterLab provides clear error messages in the response body if a scrape fails due to a timeout or a blocked request.
Ensure your retry logic accounts for the following:
429 Too Many Requests: You have hit your-per-second rate limit. Implement exponential backoff.402 Payment Required: Your balance is empty.
Cost comparison
One of the most common reasons for migrating is the shift from subscription-based models to a pure usage-based model. With AlterLab, you don'1t pay for "unused"-capacity-heavy tiers. You pay for what you use.
You can view our full-scale pricing breakdown at our pricing page.
Common issues and fixes
- Missing JS Content: If you migrate a task and notice the content is missing elements, ensure you added
js_render=Trueto your request. - Timeout errors: Some heavy-duty sites require more time. Use the
timeoutparameter in thescrapemethod to give the headless browser more time to execute scripts. - Authentication: Ensure your
.envfile is updated. Many developers forget to swap the oldCRAWLBASE_TOKENvariable for the newALTERLAB_API_KEY.
You're done
Your migration is complete. Your code is now more concise, your API keys are unified, and you are no longer tied to monthly minimums.
If you run into issues during the transition, check our API documentation or hit reply to our support email.
FAQ
Q: How long does it take to migrate from Crawlbase to AlterLab? A: Most developers complete the swap in under 30 minutes. Since the request logic is almost identical, you only need to update your API client and your authentication keys.
Q: Will my existing Crawlbase code work with AlterLab?
A: If you use requests in Python or fetch in JavaScript, yes. You just need to change the base URL and the parameter names. If you use their specific SDK, you will need to switch to the AlterLab SDK.
Q: How does AlterLab pricing compare to Crawlbase? A: AlterLab offers a pay-as-you-go model starting at $0.0002 per request. Unlike Crawlbase, there are no monthly subscription minimums and your balance never expires.
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
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.