Skip to main content

crewai-alterlab

CrewAI integration for the AlterLab web scraping API.

Installation

pip install crewai-alterlab

Setup

Set your AlterLab API key:

export ALTERLAB_API_KEY="your-api-key"

Get your API key at alterlab.io/dashboard.

Scrape Tool

Scrape individual web pages with AlterLabScrapeTool:

from crewai_alterlab import AlterLabScrapeTool

tool = AlterLabScrapeTool()
result = tool.run("https://example.com")
print(result)

With a CrewAI Agent

from crewai import Agent, Task, Crew
from crewai_alterlab import AlterLabScrapeTool

researcher = Agent(
    role="Web Researcher",
    goal="Research topics by scraping web pages",
    backstory="You are an expert web researcher.",
    tools=[AlterLabScrapeTool()],
)

task = Task(
    description="Scrape https://example.com and summarise the content",
    expected_output="A summary of the page content",
    agent=researcher,
)

crew = Crew(agents=[researcher], tasks=[task])
result = crew.kickoff()

Custom Parameters

tool = AlterLabScrapeTool(
    scrape_params={
        "formats": ["markdown"],
        "mode": "js",  # JavaScript rendering
    },
)

Crawl Tool

Crawl multiple pages from a website with AlterLabCrawlTool:

from crewai_alterlab import AlterLabCrawlTool

tool = AlterLabCrawlTool()
result = tool.run(url="https://docs.example.com", max_pages=5)
print(result)

Research Agent with Both Tools

from crewai import Agent
from crewai_alterlab import AlterLabScrapeTool, AlterLabCrawlTool

researcher = Agent(
    role="Deep Researcher",
    goal="Thoroughly research topics using web data",
    backstory="You gather comprehensive information from the web.",
    tools=[AlterLabScrapeTool(), AlterLabCrawlTool()],
)

API Reference

See docs.alterlab.io for the full AlterLab API documentation.

Search Tool

Run web searches with AlterLabSearchTool (numbered title, URL and snippet):

from crewai_alterlab import AlterLabSearchTool

tool = AlterLabSearchTool(num_results=5, search_params={"engine": "google"})
print(tool.run(query="web scraping api"))

Blocked-Fetch Fallback

BlockedFetchFallbackTool runs your own fetch first and retries through AlterLab only when the result is a 403/429, a bot-protection challenge page, a CAPTCHA, or an empty JavaScript shell. Normal pages, 404s and network errors are returned or raised untouched, so credits are spent only on blocked fetches:

import requests
from crewai_alterlab import BlockedFetchFallbackTool

tool = BlockedFetchFallbackTool(fetch=lambda url: requests.get(url, timeout=20))
print(tool.run(url="https://example.com"))

Same pattern as a standalone package

unblock-fetch is the same fallback as a drop-in requests.get with no CrewAI dependency; the result's .via is direct or alterlab:

from unblock_fetch import get

print(get("https://example.com", timeout=20).text)

Metadata

Release files for crewai-alterlab 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crewai-alterlab 0.1.2
File Size Uploaded Provenance Actions
crewai_alterlab-0.1.2.tar.gz 7.5 kB With provenance Details for crewai_alterlab-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for crewai-alterlab 0.1.2
File Interpreter ABI Platform Actions
crewai_alterlab-0.1.2-py3-none-any.whl Python 3 none any Details for crewai_alterlab-0.1.2-py3-none-any.whl

Total release size: 17.1 kB

Release files / crewai_alterlab-0.1.2.tar.gz

Download URL crewai_alterlab-0.1.2.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a21f897275c8cd4602d66e1597826ad11f4700534e29e81cdcada61ebb2d977d
BLAKE2b-256 checksum
How to use checksums
f8e671c2e44f973433e04bb6546b0ff5e30261b866cf9a959fbc1431caa7583e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / crewai_alterlab-0.1.2-py3-none-any.whl

Download URL crewai_alterlab-0.1.2-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1cbee8ad50c8bd42294dcee2f1fde301b8c6986e32d681fc575e90f7edf016e5
BLAKE2b-256 checksum
How to use checksums
e409b68f512c6cf8594d37049f7b669b028c2affb8e3be9f297d60843767c520
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Security for crewai-alterlab 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for crewai_alterlab-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page