Firecrawl

Use Firecrawl with Agno to scrape and crawl the web.

FirecrawlTools enable an Agent to perform web crawling and scraping tasks.

Prerequisites

The following example requires the firecrawl-py library and an API key which can be obtained from Firecrawl.

uv pip install -U agno firecrawl-py openai
export FIRECRAWL_API_KEY=***

Example

The following agent will crawl https://finance.yahoo.com/ and return a summary of the content:

from agno.agent import Agent
from agno.tools.firecrawl import FirecrawlTools

agent = Agent(tools=[FirecrawlTools(enable_scrape=False, enable_crawl=True)], markdown=True)
agent.print_response("Summarize this https://finance.yahoo.com/")

Toolkit Params

ParameterTypeDefaultDescription
api_keystrNoneAPI key for authentication. Uses FIRECRAWL_API_KEY env var if not provided
enable_scrapeboolTrueEnables website scraping functionality
enable_crawlboolFalseEnables website crawling functionality
enable_mappingboolFalseEnables website mapping functionality
enable_searchboolFalseEnables web search functionality
allboolFalseEnables all functionality when set to True
formatsList[str]NoneList of formats to be used for operations
limitint10Maximum number of items to retrieve
poll_intervalint30Interval in seconds between polling for results
search_paramsDict[str, Any]NoneParameters for search operations
api_urlstrhttps://api.firecrawl.devAPI URL to use for the Firecrawl app

Toolkit Functions

FunctionDescription
scrape_websiteScrapes a website using Firecrawl. Parameters include url to specify the URL to scrape. The function supports optional formats if specified. Returns the results of the scraping in JSON format.
crawl_websiteCrawls a website using Firecrawl. Parameters include url to specify the URL to crawl. An optional per-call limit overrides the toolkit-level limit. The function supports optional formats and returns the crawling results in JSON format.
map_websiteMaps a website structure using Firecrawl. Parameters include url to specify the URL to map. Returns the mapping results in JSON format.
search_webPerforms a web search using Firecrawl. Parameters include query for the search term. An optional per-call limit overrides search_params["limit"], which overrides the toolkit limit. Returns search results in JSON format.

Developer Resources