
How to Migrate from Scrapfly to AlterLab: Step-by-Step Guide (2026)
Learn how to migrate from Scrapfly to AlterLab in under an hour. Switch to pay-as-you-go pricing with this practical guide for Python and REST API users.
AlterLab handles this automatically — scrape any URL with one API call. No infrastructure required.
Try it freeTL;DR
To migrate from Scrapfly to AlterLab, install the alterlab Python SDK, replace the ScrapflyClient with alterlab.Client, and update your API key in your environment variables. Because both services use similar REST API structures, your existing scraping logic and URL targets require zero modification.
Why migrate?
Many developers find Scrapfly's credit-based subscription plans restrictive, particularly as credits are consumed at different rates depending on the tier used. This often leads to overpaying for unused credits or running out of balance mid-project.
AlterLab solves this by removing the subscription requirement entirely. You pay only for what you use, your balance never expires, and there are no monthly minimums. Both APIs are capable, but this guide is for developers prioritizing pay-as-you-go pricing and no subscription requirements. For a deeper dive, see our detailed Scrapfly comparison.
Prerequisites
Before starting, ensure you have the following:
- An AlterLab account (create one for free at alterlab.io/signup)
- Your AlterLab API key from the dashboard
- 5 minutes of development time
Step 1: Install the AlterLab SDK
If you are using Python, you can use our lightweight SDK. If you prefer raw HTTP requests, you can use the REST API directly via curl or requests.
pip install alterlabFor a more comprehensive setup, refer to our Getting started guide.
Step 2: Replace your API calls
The transition is a straightforward swap of the client initialization and the scrape method. AlterLab simplifies the request process by removing the need for a separate configuration object for basic scrapes.
Python SDK Migration
Compare the two implementations below. Note how the ScrapeConfig is replaced by direct parameters in the scrape method.
from scrapfly import ScrapflyClient, ScrapeConfig
client = ScrapflyClient("SF_API_KEY")
config = ScrapeConfig(
url="https://example.com",
asp=True,
render_js=True
)
response = client.scrape(config)
print(response.content)import alterlab
client = alterlab.Client("ALTERLAB_API_KEY")
# Use min_tier=3 for JavaScript rendering (equivalent to render_js=True)
response = client.scrape("https://example.com", min_tier=3)
print(response.text)REST API Migration
If you are using curl or a generic HTTP client, you only need to change the endpoint and the parameter names.
Scrapfly Endpoint:
https://api.scrapfly.io/scrape?key=KEY&url=URL&asp=true
AlterLab Endpoint:
https://api.alterlab.io/scrape?api_key=KEY&url=URL
Step 3: Handle response format differences
Both services return the page content, but the object attributes differ slightly.
- Scrapfly: Uses
.contentfor the HTML body. - AlterLab: Uses
.textfor the HTML body.
If you are using AlterLab's Formats feature, you can request json, markdown, or text directly in the API call, which eliminates the need for manual cleaning in your post-processing pipeline.
Step 4: Update your error handling
AlterLab uses standard HTTP status codes. If you have a retry loop based on Scrapfly's specific error codes, update them to handle standard 4xx and 5xx responses.
Common status codes to monitor:
401: Invalid API key.402: Insufficient balance.429: Rate limit reached.
Cost comparison
The primary driver for this migration is the billing model. Scrapfly requires a monthly commitment to maintain certain tiers. AlterLab removes the monthly overhead.
Example: 10,000 standard requests.
For a full breakdown of costs per tier, visit AlterLab pricing.
Common issues and fixes
- JS Rendering not working: If a page requires JavaScript, ensure you set
min_tier=3. This tells the engine to skip basic curl and go straight to a headless browser. - Timeout errors: If you are scraping heavy pages, increase your client timeout. AlterLab's automatic escalation can take a few extra seconds to find the optimal proxy.
- Response encoding: AlterLab returns UTF-8 by default. If you see encoding issues, ensure your environment is set to handle UTF-8 strings.
You're done
Your migration is complete. You can now run your scrapers without worrying about monthly credit expiration or tiered consumption rates.
For more advanced features like Cortex AI for structured data extraction or Webhooks for push notifications, check our documentation.
Hit reply if you have questions.
AlterLab // Web Data, Simplified.
Was this article helpful?
Frequently Asked Questions
Related Articles

How to Feed Live Web Data into a Vector Database for RAG
Learn how to stream scraped web pages directly into a vector database for retrieval-augmented generation, using AlterLab's API and open-source tools.
Herald Blog Service

AI Research Agent: Web Search + Structured Extraction
Learn how to build an AI research agent that combines web search with AlterLab's scraping API to extract structured data from public web pages, using Python SDK and cron scheduling.
Herald Blog Service

Automating Competitive Intelligence with Web Data APIs
Learn how to automate competitive intelligence pipelines using web data APIs and LLM summarization to extract, process, and summarize market data at scale.
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)

AlterLab vs Firecrawl: Which Scraping API Is Better in 2026?

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

How to Scrape Cloudflare-Protected Sites 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
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.