```yaml
product: AlterLab
title: "How to Migrate from Apify 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-25
canonical_facts:
  - "Practical steps to move your scraping workflow from Apify to AlterLab, keeping code changes minimal and costs predictable."
source_url: https://alterlab.io/blog/how-to-migrate-from-apify-to-alterlab-step-by-step-guide-2026
```

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

## TL;DR
To migrate from Apify to AlterLab, install the AlterLab SDK, replace your Apify client with alterlab.Client using your AlterLab API key, and keep the same scrape calls. The response format is similar, so minimal code changes are needed.

## Why migrate?
Apify’s actor marketplace and compute unit billing can make costs unpredictable for simple scraping tasks. AlterLab offers a pay‑as‑you‑go model with no subscription, so you only pay for the requests you make.

## Prerequisites
- An AlterLab account (free at [free sign-up](/signup))
- Your AlterLab API key from the dashboard
- About five minutes to update your code

## Step 1: Install the AlterLab SDK
You can use the REST API directly, but the Python SDK mirrors the Apify client pattern.

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

See the [Getting started guide](/docs/quickstart/installation) for other language options.

## Step 2: Replace your API calls
Below is a side‑by‑side comparison of a basic scrape request.

```python title="before_apify.py"
# Apify (before migration)
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("actor_id").call(run_input={"url": "https://example.com"})
# Fetch results from the run's default dataset
```

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

client = alterlab.Client("YOUR_ALTERLAB_API_KEY")
response = client.scrape("https://example.com")
print(response.text)  # Same HTML, pay‑as‑you‑go pricing
```

The AlterLab `scrape` method returns an object with `text`, `html`, and `json` attributes, similar to Apify’s dataset items.

## Step 3: Handle response format differences
Apify returns data through a dataset that you must iterate over. AlterLab returns the scraped content directly in the response object.

- If you need JSON output, add `formats=['json']` to the scrape call.
- For raw HTML, use `response.html` (same as Apify’s HTML field).
- Metadata such as status code and headers are available via `response.status_code` and `response.headers`.

## Step 4: Update your error handling
AlterLab uses standard HTTP status codes:
- 200: Success
- 429: Rate limit – retry after the `Retry-After` header
- 500‑503: Temporary issues – exponential backoff works as before

Replace any Apify‑specific error checks with generic HTTP status handling. Retry logic from your existing Apify code can be reused unchanged.

## Cost comparison
For a typical workload of 10,000 requests per month:

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

- AlterLab: 10,000 × $0.0002 = $2.00, no monthly fee, balance never expires.
- Apify: Compute unit pricing varies; a similar volume often incurs a monthly subscription plus usage fees, making the total higher and less predictable.

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

## Common issues and fixes
- **Missing API key**: Double‑check that you placed the AlterLab key in your environment variable or config file.
- **Unexpected response format**: Ensure you are accessing `response.text` or `response.json()` as needed; AlterLab does not wrap data in a dataset layer.
- **Rate limit headers**: AlterLab sends `Retry-After` seconds; adjust your backoff logic to read this header.
- **Proxy authentication**: AlterLab handles proxy rotation automatically; remove any manual proxy settings from your Apify code.

## You're done
Your migration is complete. Run your test suite to confirm everything works, then deploy. For more details, see the [detailed Apify comparison](/vs/apify) and the AlterLab documentation.

AlterLab // Web Data, Simplified.

## Frequently Asked Questions

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

Typically under an hour. Most existing code stays the same; you only update the API key and replace the client library.

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

Yes. AlterLab uses a compatible REST API and similar response structure, so only the client initialization and calls need adjusting.

### How does AlterLab pricing compare to Apify?

AlterLab charges $0.0002 per request with no monthly minimum and no balance expiry, unlike Apify's compute unit and subscription model.

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