Tutorials

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

Learn how to migrate from ScrapingBee to AlterLab in under an hour with pay-as-you-go pricing, no subscription, and minimal code changes.

3 min read
4 views

TL;DR

To migrate from ScrapingBee to AlterLab, install the AlterLab Python SDK, replace your ScrapingBee client with alterlab.Client, and update your API key. The request format and response structure are nearly identical, so most of your existing code works unchanged.

Why migrate?

ScrapingBee requires a monthly subscription plan even if you use few credits. AlterLab offers a pure pay‑as‑you‑go model: you only pay for what you use, your balance never expires, and there are no mandatory monthly fees.

Prerequisites

  • An AlterLab account (create one for free at /signup)
  • Your AlterLab API key (found in the dashboard)
  • About five minutes to install the SDK and update your calls

Step 1: Install the AlterLab SDK

You can install the official Python package or call the REST API directly. The SDK mirrors the ScrapingBee client pattern.

Bash
pip install alterlab

For full setup details, see the Getting started guide.

Step 2: Replace your API calls

Below is a direct before‑and‑after comparison. The only changes are the import, client initialization, and API key.

Python
# ScrapingBee (before migration)
from scrapingbee import ScrapingBeeClient

client = ScrapingBeeClient(api_key="YOUR_SCRAPINGBEE_KEY")
response = client.get(
    url="https://example.com",
    params={"render_js": True}
)
print(response.content)
Python
# AlterLab (after migration)
import alterlab

client = alterlab.Client("YOUR_ALTERLAB_API_KEY")
response = client.scrape(
    url="https://example.com",
    params={"render_js": True}
)
print(response.text)  # Same data, pay‑as‑you‑go pricing

Step 3: Handle response format differences

AlterLab returns a response object with the same attributes you used with ScrapingBee:

  • response.text (or response.content for bytes)
  • response.status_code
  • response.headers

If you accessed response.json() on ScrapingBee, note that AlterLab does not auto‑parse JSON; you must json.loads(response.text) yourself. Otherwise, the structure is compatible.

Step 4: Update your error handling

Both services use HTTP status codes to signal issues. AlterLab returns:

  • 429 for rate limits (same as ScrapingBee)
  • 402 when your balance is insufficient (ScrapingBee uses 403 for auth issues)
  • 5xx for upstream target errors

Adjust any custom retry logic to treat 402 as an out‑of‑balance condition rather than an authentication failure. Otherwise, your existing retry‑on‑429 logic works unchanged.

Cost comparison

Consider a workload of 10,000 requests per month.

PlatformCost for 10,000 requestsMonthly minimumBalance expiry
AlterLab$2.00 (10,000 × $0.0002)$0Never
ScrapingBee$49.00 (base plan)$49.00Credits expire monthly
$0.0002Per Request (AlterLab)
$0Monthly Minimum
NeverBalance Expiry

Both APIs are capable — this guide is for developers prioritizing pay‑as‑you‑go pricing and no subscription requirements. See the AlterLab pricing page for full details.

Common issues and fixes

  • Missing render_js flag – AlterLab uses smart‑tier routing; you can explicitly set min_tier=3 for JavaScript sites instead of render_js.
  • JSON parsing – AlterLab returns raw HTML/text by default. Add params={"format": "json"} if you need JSON output, then parse response.text.
  • Error 402 – Check your balance in the dashboard or add a balance‑check endpoint before batch jobs.
  • Proxy headers – If you relied on ScrapingBee’s proxy_address header, AlterLab provides equivalent data under response.headers["X-AlterLab-Proxy"].

You're done

Your migration is complete. Run your test suite to confirm everything works, then deploy. For more advanced options (scheduling, webhooks, Cortex AI), refer to the full documentation.

AlterLab // Web Data, Simplified.

Share

Was this article helpful?

Frequently Asked Questions

Typically under an hour. Most existing code remains unchanged; you only need to install the AlterLab SDK and replace your API key.
Yes. AlterLab uses a compatible REST API and similar response format, so the Python SDK migration is straightforward with minimal adjustments.
AlterLab charges $0.0002 per request with no monthly minimum and balance never expires. ScrapingBee requires a monthly plan (e.g., $49/mo for 1M credits) regardless of usage.