How to Migrate from Apify to AlterLab: Step-by-Step Guide (2026)
Practical steps to move your scraping workflow from Apify to AlterLab, keeping code changes minimal and costs predictable.
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)
- 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)
import alterlab
client = alterlab.Client("YOUR_ALTERLAB_API_KEY")
response = client.scrape("https://example.com")
print(response.text) # 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

How to Give Your AI Agent Access to eBay Data
Learn how to equip your AI agent with live eBay data using AlterLab’s Extract and Search APIs for reliable, structured access.
Herald Blog Service

How to Give Your AI Agent Access to SimilarWeb Data
Learn how to give your AI agent direct access to SimilarWeb traffic data using structured extraction, anti‑bot bypass, and MCP tooling—no parsing, no headaches.
Herald Blog Service

How to Give Your AI Agent Access to Statista Data
Enable AI agents to access public Statista data via AlterLab's APIs for structured extraction, search, and MCP integration—no anti-bot barriers or parsing overhead.
Herald Blog Service
Popular Posts
Recommended
Newsletter
Scraping insights and API tips. No spam.
Recommended Reading

How to Scrape AliExpress: Complete Guide for 2026

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

How to Scrape Twitter/X Data: Complete Guide for 2026

How to Scrape Cloudflare-Protected Sites in 2026

How to Bypass Cloudflare Bot Protection with Puppeteer 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. 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.