```yaml
product: AlterLab
title: "How to Migrate from ScraperBox to AlterLab: Step-by-Step Guide (2026)"
category: Tutorials
comparison_context: "AlterLab is an alternative to Firecrawl, ScrapingBee, and Bright Data."
last_updated: 2026-07-20
canonical_facts:
  - "Learn how to switch from ScraperBox to AlterLab in under an hour with pay-as-you-go pricing, no subscriptions, and minimal code changes."
source_url: https://alterlab.io/blog/how-to-migrate-from-scraperbox-to-alterlab-step-by-step-guide-2026
```

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

Both APIs are capable — this guide is for developers prioritizing pay-as-you-go pricing and no subscription requirements.

## TL;DR
To migrate from ScraperBox to AlterLab, sign up for a free AlterLab account, install the AlterLab Python SDK, replace your ScraperBox client calls with alterlab.Client, and update your API key. The response format is largely unchanged, so most of your existing code works without modification.

## Why migrate?
ScraperBox uses monthly subscription plans with separate pricing for JavaScript rendering add-ons, which can increase costs unpredictably. AlterLab eliminates subscriptions, charges a flat pay-as-you-go rate, and includes JavaScript rendering in the base price, giving you predictable costs and no wasted balance.

## Prerequisites
- An AlterLab account (create one for free at [/signup](/signup))
- Your AlterLab API key (found in the dashboard)
- About 5 minutes of time

## Step 1: Install the AlterLab SDK
If you prefer using the official Python SDK, install it with pip. You can also call the REST API directly, but the SDK simplifies authentication and retries.

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

For more details, see the [Getting started guide](/docs/quickstart/installation).

## Step 2: Replace your API calls
Below is a side‑by‑side comparison of a typical ScraperBox request and the equivalent AlterLab call. The only changes are the import, client initialization, and the API key.

```python title="before_scraperbox.py"
# ScraperBox (before migration)
import requests

TOKEN = "YOUR_SCRAPERBOX_TOKEN"
url = "https://example.com"

response = requests.get(
    "https://api.scraperbox.com/scrape",
    params={"token": TOKEN, "url": url, "use_browser": True}
)
html = response.text
```

```python title="after_alterlab.py" {3-7}
# AlterLab (after migration)
import alterlab

client = alterlab.Client("YOUR_ALTERLAB_API_KEY")
response = client.scrape("https://example.com", use_browser=True)
html = response.text  # Same data, pay-as-you-go pricing
```

If you are using the raw REST endpoint, replace the base URL and token name:

```python title="after_alterlab_rest.py"
import requests

ALTERLAB_TOKEN = "YOUR_ALTERLAB_API_KEY"
url = "https://example.com"

response = requests.get(
    "https://api.alterlab.io/v1/scrape",
    params={"token": ALTERLAB_TOKEN, "url": url, "use_browser": True}
)
html = response.text
```

## Step 3: Handle response format differences
AlterLab returns a JSON object with the same top‑level fields as ScraperBox: `text` (or `html`), `status_code`, and `headers`. The only difference is that AlterLab nests error details under an `error` key when `status_code` is not 200, whereas ScraperBox returned a plain error body. Check `response.status_code` before accessing `response.text`.

```python title="response_handling.py"
if response.status_code == 200:
    html = response.text
else:
    # AlterLab returns structured error info
    print(f"Error {response.status_code}: {response.json().get('error')}")
```

## Step 4: Update your error handling
Both services use HTTP status codes to signal problems. AlterLab uses 429 for rate limiting and 402 for insufficient balance. Your existing retry logic based on status codes will work unchanged; just ensure you treat 402 as a signal to top up your balance rather than an authentication error.

```python title="error_handling.py"
import time
import alterlab

client = alterlab.Client("YOUR_ALTERLAB_API_KEY")
max_retries = 3
for attempt in range(max_retries):
    response = client.scrape("https://example.com")
    if response.status_code == 200:
        break
    if response.status_code == 429:
        time.sleep(2 ** attempt)  # exponential backoff
    elif response.status_code == 402:
        raise Exception("Insufficient AlterLab balance")
    else:
        raise Exception(f"Request failed: {response.status_code}")
```

## Cost comparison
Consider a scenario of 10,000 requests per month with JavaScript rendering enabled.

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

- **AlterLab**: 10,000 × $0.0002 = $2.00 per month, no subscription, balance never expires.
- **ScraperBox** (based on public pricing): $20 monthly subscription + $0.001 per request for JavaScript rendering = $20 + (10,000 × $0.001) = $30 per month.

See the full breakdown on the [AlterLab pricing](/pricing) page.

## Common issues and fixes
- **Missing `use_browser` parameter**: AlterLab defaults to `false`. Add `use_browser=True` for sites that require JavaScript.
- **API key environment variable**: If you stored your ScraperBox token in `SCRAPERBOX_TOKEN`, rename it to `ALTERLAB_API_KEY` or update your code to read the new variable.
- **Response encoding**: AlterLab always returns UTF‑8 text. If you relied on ScraperBox’s automatic encoding detection, explicitly decode with `response.text.encode('utf-8')` if needed.
- **Rate limit headers**: AlterLab sends `X-RateLimit-Remaining` and `X-RateLimit-Reset`. Adjust any logic that scraped these headers from ScraperBox.

## 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, refer to the [documentation](/docs). If you hit any snags, hit reply if you have questions.

AlterLab // Web Data, Simplified.

## Frequently Asked Questions

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

Typically under an hour. Most existing code stays the same; you only need to install the AlterLab SDK, swap the API key, and update the client call.

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

Yes. AlterLab uses the same REST API structure and returns a similar response format, so the Python SDK migration is straightforward with minimal changes.

### How does AlterLab pricing compare to ScraperBox?

AlterLab charges $0.0002 per request with no monthly minimum and no balance expiry, while ScraperBox requires a subscription plus separate fees for JavaScript rendering add-ons.

## Related

- [TechCrunch Data API: Extract Structured JSON in 2026](<https://alterlab.io/blog/techcrunch-data-api-extract-structured-json-in-2026>)
- [How to Scrape Nordstrom Data: Complete Guide for 2026](<https://alterlab.io/blog/how-to-scrape-nordstrom-data-complete-guide-for-2026>)
- [How to Scrape Zara Data: Complete Guide for 2026](<https://alterlab.io/blog/how-to-scrape-zara-data-complete-guide-for-2026>)