langchain_community.document_loaders.firecrawl
.FireCrawlLoader¶
- class langchain_community.document_loaders.firecrawl.FireCrawlLoader(url: str, *, api_key: Optional[str] = None, mode: Literal['crawl', 'scrape'] = 'crawl', params: Optional[dict] = None)[source]¶
Load web pages as Documents using FireCrawl.
- Must have Python package firecrawl installed and a FireCrawl API key. See
https://www.firecrawl.dev/ for more.
Initialize with API key and url.
- Parameters
url (str) – The url to be crawled.
api_key (Optional[str]) – The Firecrawl API key. If not specified will be read from env var FIREWALL_API_KEY. Get an API key
mode (Literal['crawl', 'scrape']) – The mode to run the loader in. Default is “crawl”. Options include “scrape” (single url) and “crawl” (all accessible sub pages).
params (Optional[dict]) – The parameters to pass to the Firecrawl API. Examples include crawlerOptions. For more details, visit: https://github.com/mendableai/firecrawl-py
Methods
__init__
(url, *[, api_key, mode, params])Initialize with API key and url.
A lazy loader for Documents.
aload
()Load data into Document objects.
A lazy loader for Documents.
load
()Load data into Document objects.
load_and_split
([text_splitter])Load Documents and split into chunks.
- __init__(url: str, *, api_key: Optional[str] = None, mode: Literal['crawl', 'scrape'] = 'crawl', params: Optional[dict] = None)[source]¶
Initialize with API key and url.
- Parameters
url (str) – The url to be crawled.
api_key (Optional[str]) – The Firecrawl API key. If not specified will be read from env var FIREWALL_API_KEY. Get an API key
mode (Literal['crawl', 'scrape']) – The mode to run the loader in. Default is “crawl”. Options include “scrape” (single url) and “crawl” (all accessible sub pages).
params (Optional[dict]) – The parameters to pass to the Firecrawl API. Examples include crawlerOptions. For more details, visit: https://github.com/mendableai/firecrawl-py
- async alazy_load() AsyncIterator[Document] ¶
A lazy loader for Documents.
- Return type
AsyncIterator[Document]
- lazy_load() Iterator[Document] [source]¶
A lazy loader for Documents.
- Return type
Iterator[Document]
- load_and_split(text_splitter: Optional[TextSplitter] = None) List[Document] ¶
Load Documents and split into chunks. Chunks are returned as Documents.
Do not override this method. It should be considered to be deprecated!
- Parameters
text_splitter (Optional[TextSplitter]) – TextSplitter instance to use for splitting documents. Defaults to RecursiveCharacterTextSplitter.
- Returns
List of Documents.
- Return type
List[Document]