How to Migrate from Apify to AlterLab: Step-by-Step Guide (2026)
How to Migrate from Apify to AlterLab: StepbyStep Guide 2026 TL;DR To migrate from Apify to AlterLab, install the AlterLab SDK, replace your Apify client...
AlterLab handles this automatically — scrape any URL with one API call. No infrastructure required.
Try it freeTL;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)
- 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.
pip install alterlabSee the Getting started guide for other language options.
Step 2: Replace your API calls
Below is a side‑by‑side comparison of a basic scrape request.
# 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# AlterLab (after migration)
from alterlab import AlterLabSync
client = AlterLabSync("YOUR_ALTERLAB_API_KEY")
response = client.scrape("https://example.com")
print(response["content"]) # Same HTML, pay‑as‑you‑go pricingThe 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_codeandresponse.headers.
Step 4: Update your error handling
AlterLab uses standard HTTP status codes:
- 200: Success
- 429: Rate limit – retry after the
Retry-Afterheader - 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:
- 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 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.textorresponse.json()as needed; AlterLab does not wrap data in a dataset layer. - Rate limit headers: AlterLab sends
Retry-Afterseconds; 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 and the AlterLab documentation.
AlterLab // Web Data, Simplified.
Was this article helpful?
Frequently Asked Questions
Related Articles

Scheduling Recurring Scrapes with Python and Cron
Learn how to schedule recurring scrapes with Python and cron, choose safe intervals, prevent duplicate runs, handle failures, and build reliable data pipelines.
Herald Blog Service

Job Listing Aggregation with Web Scraping
Build job listing aggregation with web scraping. Learn source discovery, extraction, normalization, deduplication, and refresh design for data engineers.
Herald Blog Service

Browser Fingerprinting: TLS, HTTP/2, and JavaScript Signals
Browser fingerprinting combines TLS, HTTP/2, and JavaScript signals. Learn how each layer works and how to build reliable, ethical scraping pipelines at scale.
Herald Blog Service
Popular Posts
Recommended

Selenium Bot Detection: Why You Get Flagged and How to Fix It

Understanding Anti-Bot Detection: Fingerprinting and Rate Limits

Why Your Headless Browser Gets Detected (and How to Fix It)

Mastering Playwright Stealth for Agentic Web Workflows

Playwright Bot Detection: What Actually Works in 2026
Newsletter
Scraping insights and API tips. No spam.
Recommended Reading

Selenium Bot Detection: Why You Get Flagged and How to Fix It

Understanding Anti-Bot Detection: Fingerprinting and Rate Limits

Why Your Headless Browser Gets Detected (and How to Fix It)

Mastering Playwright Stealth for Agentic Web Workflows

Playwright Bot Detection: What Actually Works in 2026
Stay in the Loop
Get scraping insights, API tips, and platform updates. No spam — we only send when we have something worth reading.
Explore AlterLab
Anti-Bot Handling API
Automatic challenge handling for protected sites — works out of the box.
JavaScript Rendering API
Render SPAs and dynamic content with headless Chromium.
Pricing
5-tier pricing from $0.0002/page. Up to 5,000 free requests to start.
Documentation
API reference, SDKs, quickstart guides, and tutorials.
Web Scraping API Resources
Part of the Web Scraping API Documentation cluster
Complete API reference with 5-tier auto-escalation — Curl to challenge resolution.
Pillar pageConfigure Tier 4 browser rendering for SPAs and dynamic content.
Scrape pages behind login using session management.
Real success rates and cost data across all 5 tiers.
MCP Server, Python SDK, and Firecrawl-compatible API for AI agent workflows.