Tutorials

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

Learn how to migrate from Zyte to AlterLab in under an hour. This guide covers SDK replacement, API updates, and moving to a unified pay-as-you-go model.

4 min read
6 views

AlterLab handles this automaticallyscrape any URL with one API call. No infrastructure required.

Try it free

TL;DR

To migrate from Zyte to AlterLab, replace your zyte-api client with the alterlab SDK, swap your API key, and update your request method. Because AlterLab follows a similar RESTful pattern and provides unified anti-bot bypass, most of your existing URL logic and data parsing code will remain unchanged.

Why migrate?

The primary driver for migration is the fragmented product suite found in many large-scale scraping setups. At Zyte, developers often manage separate billing and configurations for Zyte API, Smart Proxy, and Scrapy Cloud.

AlterLab consolidates these into a single engine. We provide automatic anti-bot bypass, rotating proxies, and smart-tier routing (from T1 curl requests to T5 captcha-solving browsers) under one unified balance. Both APIs are capable — this guide is for developers prioritizing pay-as-you-go pricing and no subscription requirements. For a deeper look at the technical differences, see our detailed Zyte comparison.

Prerequisites

Before you begin, ensure you have the following:

  • An AlterLab account (free sign-up)
  • Your AlterLab API key from the dashboard
  • Python 3.8+ installed in your environment
  • Approximately 15 minutes for testing and deployment

Step 1: Install the AlterLab SDK

While you can interact with AlterLab via standard curl commands or any HTTP client, using our native SDK is the fastest way to migrate.

Run the following command in your terminal:

Bash
pip install alterlab

For more details on environment configuration, refer to our Getting started guide.

Step 2: Replace your API calls

The core of your migration involves swapping the client initialization and the request method. Zyte typically uses client.scrape(), whereas AlterLab uses client.scrape(). The syntax is nearly identical, making this a low-friction change.

Below is a side-by-side comparison of a standard implementation.

Python
# Zyte (before migration)
from zyte_api import ZyteAPI

client = ZyteAPI(api_key="YOUR_ZYTE_API_KEY")
target_url = "https://example.com"

# Zyte specific request structure
response = client.scrape(url=target_url)
print(response.text)
Python
# AlterLab (after migration)
import alterlab

client = alterlab.Client("YOUR_ALTERLAB_API_KEY")
target_url = "https://example.com"

# AlterLab request (Supports automatic tier escalation)
response = client.scrape(target_url)
print(response.text)  # Same data, pay-as-you-go pricing

Step 3: Handle response format differences

Zyte often returns deeply nested JSON objects if you are using their specific extraction features. AlterLab is designed to be flexible. By default, we return the raw page content, but you can request specific formats directly in the call.

If your existing pipeline expects JSON, use the formats parameter. This prevents you from having to write custom parsing logic to wrap the response.

Python
response = client.scrape(
    "https://example.com", 
    formats=["json"]
)
print(response.json())

If you need to extract specific data points without writing selectors, we recommend moving your logic to Cortex AI. Instead of maintaining complex CSS paths, you can simply pass a schema to the API.

Step 4: Update your error handling

When moving from a subscription-based model to a balance-based model, your error handling should account for balance depletion.

  1. Authentication Errors: Ensure your .env file is updated with the new ALTERLAB_API_KEY.
  2. Balance Errors: If your balance hits zero, the API will return a 402 Payment Required status. In Zyte, you might encounter service interruptions based on tier limits; in AlterLab, the service is limited strictly by your current balance.
  3. Tier Escalation: If a site requires JavaScript rendering (like a React or Vue app), AlterLab will automatically escalate from T1 to higher tiers if configured. You don't need to manually switch between "browser" and "proxy" settings.

Cost comparison

The biggest shift for most teams is moving away from monthly "buckets" of credits. AlterLab operates on a pure pay-as-you-go model. There are no monthly minimums and your balance never expires.

$0.0002Per Request (AlterLab)
$0Monthly Minimum
NeverBalance Expiry

For a detailed breakdown of how different request tiers affect your spend, visit our AlterLab pricing page. Generally, for standard high-volume scraping (10,000 requests), you will find that the ability to pay only for what you use eliminates the "wasted credit" problem common in subscription models.

Common issues and fixes

  • Selector Failures: If your existing Scrapy or BeautifulSoup selectors fail, the site may have triggered a bot challenge. Instead of upgrading your proxy plan, simply set min_tier=3 in your AlterLab request to force JavaScript rendering.
  • Missing Data in JSON: If you were using Zyte's automatic extraction, you'll need to transition to AlterLab's Cortex AI. This allows you to send a natural language instruction (e.g., "extract all product prices") and receive structured JSON.
  • Webhook Latency: If you are using webhooks to push data to your server, ensure your endpoint is ready to receive the AlterLab payload structure, which is flatter and more direct than Zyte's extraction responses.

You're done

Once your tests pass with the AlterLab SDK, you are ready to deploy. Most developers find that the combination of a single API key and automatic tier escalation reduces the complexity of their scraping infrastructure significantly.

For further assistance or specific implementation questions, check our documentation or hit reply to our support email.

Share

Was this article helpful?

Frequently Asked Questions

Typically under an hour. Most of your scraping logic remains intact; you only need to update your API key and swap the client library.
Not exactly, but it is very similar. You will swap the Zyte client for the AlterLab client, and since both use REST-based patterns, the transition is straightforward.
AlterLab uses a pay-as-you-go model starting at $0.0002 per request with no monthly minimums or expiring balances, whereas Zyte often requires managing multiple separate subscriptions for API, Proxies, and Scrapy Cloud.