```yaml
product: AlterLab
title: "How to Migrate from Smartproxy 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-11
canonical_facts:
  - Learn how to migrate from Smartproxy to AlterLab in under an hour. Replace bandwidth-based billing with pay-as-you-go pricing and a streamlined API.
source_url: https://alterlab.io/blog/how-to-migrate-from-smartproxy-to-alterlab-step-by-step-guide-2026
```

## TL;DR
To migrate from Smartproxy to AlterLab, install the `alterlab` Python SDK, replace your Smartproxy client initialization with `alterlab.Client("YOUR_API_KEY")`, and update your request calls to use the AlterLab `.scrape()` method. The transition typically takes less than 60 minutes as the REST API and response formats are designed for high compatibility.

## Why migrate?
Many developers migrate because Smartproxy utilizes bandwidth-based proxy billing, which often requires a separate subscription for their scraping API. AlterLab solves this by offering a unified pay-as-you-go model. You pay only for the successful requests you make, with no monthly minimums or subscription requirements.

Both APIs are capable — this guide is for developers prioritizing pay-as-you-go pricing and no subscription requirements. For a deeper dive into the architectural differences, see our [detailed Smartproxy comparison](/vs/smartproxy).

## Prerequisites
Before starting the migration, ensure you have the following:
- An AlterLab account (create one for [free sign-up](/signup)).
- Your AlterLab API key from the dashboard.
- Approximately 5 minutes of development time.

## Step 1: Install the AlterLab SDK
You can interact with AlterLab via a direct REST API using `curl` or `requests`, but the SDK is the fastest way to migrate.

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

For more detailed setup instructions, refer to our [Getting started guide](/docs/quickstart/installation).

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

## Step 2: Replace your API calls
If you were using Smartproxy's proxy gateway or their scraping API, you can replace those blocks with a single AlterLab client.

### Before: Smartproxy Implementation
```python title="before_smartproxy.py"
import requests

# Using the proxy gateway
proxies = {
    'http': 'http://user:pwd@gate.smartproxy.com:PORT',
    'https': 'http://user:pwd@gate.smartproxy.com:PORT'
}
response = requests.get("https://example.com", proxies=proxies)

# OR using the scraping API
api_url = "https://scraper-api.smartproxy.com/v2/scrape"
params = {"url": "https://example.com", "api_key": "YOUR_KEY"}
response = requests.get(api_url, params=params)
```

### After: AlterLab Implementation
```python title="after_alterlab.py" {3-7}
import alterlab

# Initialize the client once
client = alterlab.Client("YOUR_ALTERLAB_API_KEY")

# Single call handles rotation, anti-bot, and proxying
response = client.scrape("https://example.com")

print(response.text)  # Same data, pay-as-you-go pricing
```

## Step 3: Handle response format differences
AlterLab returns a response object that mimics the standard `requests` library response. If your existing code uses `.text`, `.json()`, or `.status_code`, it will work without modification.

One key difference is that AlterLab handles the "tiering" (the level of proxy/browser needed) automatically. If you encounter a site with heavy bot protection, you can simply add the `min_tier` parameter:

```python title="tier_example.py"
# Force JavaScript rendering for complex sites
response = client.scrape("https://example.com", min_tier=3)
```

## Step 4: Update your error handling
Smartproxy and AlterLab use similar HTTP status codes for most errors (403 for Forbidden, 429 for Rate Limited). However, ensure your retry logic is updated to handle AlterLab's specific balance errors.

If your account balance reaches zero, AlterLab will return a specific error indicating insufficient balance. Since there is no monthly subscription, you simply top up your balance to resume service.

## Cost comparison
The primary driver for this migration is the billing model. Smartproxy's bandwidth-based pricing can be unpredictable if your page sizes vary. AlterLab uses a request-based model.

**Example: 10,000 successful requests**
- **Smartproxy**: Cost varies based on GB of bandwidth used + separate API subscription fee.
- **AlterLab**: 10,000 requests $\times$ $0.0002 = $2.00 (approximate, depending on tier).

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

Check the full [AlterLab pricing](/pricing) page for current rates across different tiers.

## Common issues and fixes
- **SSL Errors**: If you are using a corporate proxy, ensure your environment variables are not overriding the AlterLab SDK's internal connection.
- **Timeout Settings**: AlterLab's automatic anti-bot bypass may take slightly longer than a raw proxy request. Increase your `timeout` parameter to 30 seconds for high-tier scrapes.
- **Header Mismatches**: AlterLab automatically manages User-Agents. If you were manually setting `User-Agent` in Smartproxy, try removing it first to let AlterLab's optimization engine handle the fingerprinting.

## You're done
Your migration is complete. You now have a pay-as-you-go scraping pipeline with no recurring monthly costs. For more advanced features like scheduling or AI extraction, visit our [documentation](/docs).

## Frequently Asked Questions

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

Typically under an hour. Most of your existing scraping logic remains unchanged, as you only need to update the client library and API key.

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

Yes, the REST API structure is compatible and the response formats are similar. If using the Python SDK, the migration involves swapping the client initialization.

### How does AlterLab pricing compare to Smartproxy?

AlterLab uses a pay-as-you-go model starting at $0.0002 per request with no monthly minimums, whereas Smartproxy uses bandwidth-based proxy billing and separate scraping API subscriptions.

## Related

- [Weekly Product Roundup: SDK Drift Fix, CI Unblocking, Session Security & WAF Improvements](<https://alterlab.io/blog/weekly-product-roundup-sdk-drift-fix-ci-unblocking-session-security-waf-improvements>)
- [Understanding MCP Servers: Connecting AI to the Real-Time Web](<https://alterlab.io/blog/understanding-mcp-servers-connecting-ai-to-the-real-time-web>)
- [Building a RAG Pipeline with Live Web Data](<https://alterlab.io/blog/building-a-rag-pipeline-with-live-web-data>)