An integration package connecting Spidra and LangChain
Project description
langchain-spidra
This package contains the LangChain integration with Spidra, an AI-powered web scraping and crawling API. It lets you scrape, crawl, and batch-scrape the web — as a document loader for RAG pipelines or as agent tools.
Quick Install
pip install langchain-spidra
Get an API key from spidra.io and set it as the
SPIDRA_API_KEY environment variable (or pass api_key=...).
export SPIDRA_API_KEY="spd-your-api-key"
Document loader
SpidraLoader loads web content as LangChain Documents. Pick a mode:
scrape (one page), crawl (a whole site), or batch (many URLs in parallel).
from langchain_spidra import SpidraLoader
# Scrape a single page
loader = SpidraLoader(url="https://example.com", mode="scrape")
docs = loader.load()
print(docs[0].page_content[:200])
print(docs[0].metadata)
# Crawl an entire docs site
loader = SpidraLoader(url="https://docs.example.com", mode="crawl")
docs = loader.load()
# Batch scrape many URLs
loader = SpidraLoader(
urls=["https://a.com", "https://b.com", "https://c.com"],
mode="batch",
)
docs = loader.load()
Tools
Each Spidra capability is also available as a BaseTool you can bind to an
agent:
from langchain_spidra import SpidraScrape, SpidraCrawl, SpidraBatchScrape
scrape = SpidraScrape()
result = scrape.invoke({"url": "https://example.com"})
print(result["content"])
crawl = SpidraCrawl()
pages = crawl.invoke({"url": "https://docs.example.com", "max_pages": 20})
for page in pages:
print(page["url"], page["data"][:100])
batch = SpidraBatchScrape()
items = batch.invoke({"urls": ["https://a.com", "https://b.com"]})
Documentation
- Spidra docs: docs.spidra.io
- Spidra homepage: spidra.io
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_spidra-0.1.2.tar.gz.
File metadata
- Download URL: langchain_spidra-0.1.2.tar.gz
- Upload date:
- Size: 16.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b86e7ef073e47e3e227af5c9af55177aa40ec7f72e512713a89e533bfa2dcc8d
|
|
| MD5 |
6157adadf5b4d09f670d18a026e0454a
|
|
| BLAKE2b-256 |
62abd165ca9aeef2f64aa184c08e606616fc272b4d2f4256db26e35c8c6201e0
|
File details
Details for the file langchain_spidra-0.1.2-py3-none-any.whl.
File metadata
- Download URL: langchain_spidra-0.1.2-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdb0e93678bd2a85992fb85bbf72f702f59b194475aa12fe8a94ba4f4ef134c6
|
|
| MD5 |
4fca3d611ec822371d2b181195e92426
|
|
| BLAKE2b-256 |
68cece93d8c7ed36e3d04350d2072ba276878ebfdb11cfce984ecaa8d6e9e4e0
|