How to Migrate from Crawlbase to AlterLab: Step-by-Step Guide (2026)
Learn how to migrate from Crawlbase to AlterLab in under 60 minutes. Follow this technical guide to unify your JS/HTML requests and switch to pay-as-you-go pricing.
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
import alterlab
client = alterlab.Client("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", js_render=True)
print(response.text)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

How AI Agents Browse the Web: Architectures and Tools
Explore the technical architecture of AI agents in 2026. Learn how LLMs, headless browsers, and advanced APIs enable autonomous web navigation and data extraction.
Herald Blog Service

Building Efficient RAG Pipelines with Clean Markdown and JSON to Reduce LLM Token Waste
Learn how to structure scraped data as Markdown and JSON to minimize token usage in RAG pipelines, improve retrieval accuracy, and lower LLM costs.
Herald Blog Service

Structured Extraction vs. Raw Scraping for LLM Apps
Learn the differences between raw HTML scraping and structured AI extraction. Discover how to optimize data pipelines for LLM and RAG applications.
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)

AlterLab vs Firecrawl: Which Scraping API Is Better in 2026?

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
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.