Skip to main content

langchain-thecrawler

This package contains the LangChain integration with TheCrawler — a web-scraping and structured-extraction API that runs the extraction LLM on its own GPU, so AI extraction is included on every page with no per-call surcharge.

Installation

pip install -U langchain-thecrawler

Set your API key (get one at miaibot.ai):

export THECRAWLER_API_KEY="mai_live_..."

Document Loader

TheCrawlerLoader loads one or more URLs as LangChain Document objects with boilerplate-stripped markdown as page_content and rich page metadata.

from langchain_thecrawler import TheCrawlerLoader

loader = TheCrawlerLoader(
    ["https://example.com"],
    # api_key="mai_live_...",  # or set THECRAWLER_API_KEY
)

docs = loader.load()        # list[Document]
# or stream:
for doc in loader.lazy_load():
    print(doc.metadata["url"], len(doc.page_content))

PDF and DOCX URLs are handled server-side. A per-page failure does not raise — failed pages come back as a Document with empty page_content and metadata["status"] == "error" plus a structured error_type, so you can branch on it:

ok = [d for d in docs if d.metadata.get("status") != "error"]

Options

Arg Description
urls A URL string or list of URLs (required)
api_key TheCrawler key; falls back to THECRAWLER_API_KEY
api_url API base URL (default https://www.miaibot.ai/api/v1)
params Extra options merged into the crawl request (e.g. {"usePlaywright": True})
timeout Per-request HTTP timeout in seconds (default 120)

License

MIT

Metadata

Release files for langchain-thecrawler 0.1.0

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

Source distribution (sdist)

Source distribution for langchain-thecrawler 0.1.0
File Size Uploaded
langchain_thecrawler-0.1.0.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-thecrawler 0.1.0
File Interpreter ABI Platform
langchain_thecrawler-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.1 kB

Release files / langchain_thecrawler-0.1.0.tar.gz

Download URL langchain_thecrawler-0.1.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4eb05e3473d1e435140b90ab804d5e574349ab92fb63cbc7e87f5aac9287000f
BLAKE2b-256 checksum
How to use checksums
c10c57bc58c848484dd376f9a5a0a4461db85a52e3b91c460791271cf07e17b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.13.6 Windows/11

Release files / langchain_thecrawler-0.1.0-py3-none-any.whl

Download URL langchain_thecrawler-0.1.0-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6a05eb6fa65fecf8b1303e46c7f87c41974ece0c1eb3abf5a16eb3e6e95255c
BLAKE2b-256 checksum
How to use checksums
1f5ec1c5b03da16f8bb74879aca84ad5b30eaf98aa83fb43dbed9690b523f035
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.13.6 Windows/11

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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