Skip to main content

An integration package connecting Firecrawl and LangChain

Project description

langchain-firecrawl

PyPI - Version PyPI - License

This package contains the LangChain integration with Firecrawl, an API that turns websites into clean, LLM-ready data. It lets you scrape, crawl, map, extract structured data from, and search the web — as a document loader or as agent tools.

Quick Install

pip install langchain-firecrawl

Get an API key from firecrawl.dev and set it as the FIRECRAWL_API_KEY environment variable (or pass api_key=...).

export FIRECRAWL_API_KEY="fc-your-api-key"

Document loader

FirecrawlLoader loads web content as LangChain Documents. Pick a mode: scrape (one page), crawl (a whole site), map (discover URLs), extract (structured data), or search (web search).

from langchain_firecrawl import FirecrawlLoader

loader = FirecrawlLoader(url="https://www.firecrawl.dev", mode="scrape")
docs = loader.load()
print(docs[0].page_content[:200])
print(docs[0].metadata)

Tools

Each Firecrawl capability is also available as a BaseTool you can bind to an agent:

from langchain_firecrawl import (
    FirecrawlScrape,
    FirecrawlCrawl,
    FirecrawlMap,
    FirecrawlExtract,
    FirecrawlSearch,
)

scrape = FirecrawlScrape()
result = scrape.invoke({"url": "https://www.firecrawl.dev"})
print(result["markdown"])

search = FirecrawlSearch()
print(search.invoke({"query": "best web scraping libraries", "limit": 5}))

Documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_firecrawl-0.1.0.tar.gz (192.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_firecrawl-0.1.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file langchain_firecrawl-0.1.0.tar.gz.

File metadata

  • Download URL: langchain_firecrawl-0.1.0.tar.gz
  • Upload date:
  • Size: 192.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.19

File hashes

Hashes for langchain_firecrawl-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f25fba0fab0603045a37ef191dc584366df0ae2373a766848522b96002ad1019
MD5 a3ee92ad58280d180952a1dbe7801456
BLAKE2b-256 3b9d933a344bbf6bf6e6df8e822413029f1ff665e531e3c92da9a8862154daa1

See more details on using hashes here.

File details

Details for the file langchain_firecrawl-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_firecrawl-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 457e27fa183ee91c224ee17d6d87d94893a7b5ade1dcec4b7be03712fb2825db
MD5 808e88e8342b9c1e388d1deae1833f2b
BLAKE2b-256 3ef0687a9a1ec74e33e63cf9d14bbfccc73a0771a25c949572783126a97e1ed2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page