```yaml
product: AlterLab
title: "How to Migrate from Crawlbase to AlterLab: Step-by-Step Guide (2026)"
category: Tutorials
comparison_context: "AlterLab is an alternative to Firecrawl, ScrapingBee, and Bright Data."
last_updated: 2026-06-28
canonical_facts:
  - 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.
source_url: https://alterlab.io/blog/how-to-migrate-from-crawlbase-to-alterlab-step-by-step-guide-2026
```

# How to Migrate from Crawlbase to AlterLab: Step-by-Step Guide (2026)

**TL;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](/vs/crawlbase).

1. **Install SDK** — 
2. **Replace API calls** — 
3. **Update API key** — 
4. **Test and deploy** — 

## Prerequisites

Before starting, ensure you have:
1. An AlterLab account (you can [sign up for free here](/signup)).
2. Your AlterLab API key from the dashboard.
3. 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.

```bash title="Terminal — Install AlterLab"
pip install alterlab
```

If you are using Node.js, run:
```bash title="Terminal — Install AlterLab Node"
npm install @alterlab/sdk
```

For more details on environment setup, check our [getting started guide](/docs/quickstart/installation).

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

```python title="before_crawlbase.py"
# 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}")
```

```python title="after_alterlab.py" {3-7}
# 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:

```python title="extracting_data.py"
# 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.

- **$0.0002** — Per Request (AlterLab)
- **$0** — Monthly Minimum
- **Never** — Balance Expiry

You can view our full-scale pricing breakdown at our [pricing page](/pricing).

## Common issues and fixes

* **Missing JS Content**: If you migrate a task and notice the content is missing elements, ensure you added `js_render=True` to your request. 
* **Timeout errors**: Some heavy-duty sites require more time. Use the `timeout` parameter in the `scrape` method to give the headless browser more time to execute scripts.
* **Authentication**: Ensure your `.env` file is updated. Many developers forget to swap the old `CRAWLBASE_TOKEN` variable for the new `ALTERLAB_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](/docs/api) 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.

## Frequently Asked Questions

### How long does it take to migrate from Crawlbase to AlterLab?

Most developers complete the migration in under 30 minutes. Since both services use RESTful principles, you only need to swap your endpoint and API key.

### Will my existing Crawlbase code work with AlterLab?

Yes, if you are using raw HTTP requests. If you use a specific client library, you will need to swap it for the AlterLab SDK, but the logic remains identical.

### How does AlterLab pricing compare to Crawlbase?

AlterLab uses a pure pay-as-you-go model with no monthly minimums. Unlike Crawlbase, your balance never expires and you don's need separate credits for JavaScript rendering.

## Related

- [Lowe's Data API: Extract Structured JSON in 2026](<https://alterlab.io/blog/lowe-s-data-api-extract-structured-json-in-2026>)
- [How to Migrate from Scrapfly to AlterLab: Step-by-Step Guide \(2026\)](<https://alterlab.io/blog/how-to-migrate-from-scrapfly-to-alterlab-step-by-step-guide-2026>)
- [Scaling Web Scraping Pipelines for High-Volume Data](<https://alterlab.io/blog/scaling-web-scraping-pipelines-for-high-volume-data>)