3 ways to ingest data from websites with Firecrawl
You can also check this cookbook in colab here
In this notebook, we’ll introduce Firecrawl, a versatile web scraping and crawling tool designed to extract data efficiently from websites, which has been integrated with CAMEL. Today we’ll walk through three key features—Scrape, Crawl, and Map—each tailored with a CAMEL agent use case.
In this notebook, you’ll explore:
-
CAMEL: A powerful multi-agent framework that enables Retrieval-Augmented Generation and multi-agent role-playing scenarios, allowing for sophisticated AI-driven tasks.
-
Firecrawl: A data ingestion tool that simplifies web data extraction through web scraping, API integration, and automated browser actions.
Table of Content:
- Introduction
- 🔥 Firecrawl: To crawl
- 🔥 Firecrawl: To Scrape
- 🔥 Firecrawl: To Map
- Conclusion
⭐ Star us on GitHub, join our Discord, or follow us on X
Introduction
Firecrawl developed by the Mendable.ai team, is a data ingestion tool that streamlines web data extraction using web scraping, API access, and automated browser interactions. It’s ideal for collecting structured and unstructured data from websites for analytics.
It effectively manages complex tasks such as handling reverse proxies, implementing caching strategies, adhering to rate limits, and accessing content blocked by JavaScript.
Features of Firecrawl:
Crawl: Collects content from all URLs within a web page, converting it into an LLM-ready format for seamless analysis.
Scrape: Extracts content from a single URL, delivering it in formats ready for LLMs, including markdown, structured data (via LLM Extract), screenshots, and HTML.
Map: Inputs a website and retrieves all URLs associated with it at high speed, enabling a comprehensive and efficient site overview.
All the above features make it ideal for collecting structured and unstructured data from websites for agentic workflows. CAMEL-AI has integrated Firecrawl to enhance its web data extraction capabilities.
📦 Installation
First, install the CAMEL package with all its dependencies and input the OPENAI API Key.
🔑 Setting Up API Keys
🔥 Firecrawl: To crawl
Let’s get started with the exploration of the first feature of Firecrawl - Crawl: Extracts content from all subpages in an LLM-ready format (markdown, structured data, screenshot, HTML, links, metadata) for easy analysis.
Step 1: Set up your firecrawl API key
You just need to go to this link and sign in to get your API Key: https://www.firecrawl.dev/app/api-keys
Alternatively, if running on Colab, you could save your API keys and tokens as Colab Secrets, and use them across notebooks.
To do so, comment out the above manual API key prompt code block(s), and uncomment the following codeblock.
⚠️ Don’t forget granting access to the API key you would be using to the current notebook.
Step 2: Import necessary modules
Step 3: Crawl the website
It will crawl the CAMEL-AI website and generate the LLM-friendly output as shown in markdown below.
Step 4: Interact with CAMEL agent
🔥 Firecrawl: To Scrape
Scrape: This feature allows you to extract content from a single URL and convert it into various formats optimized for LLMs. The data is delivered in markdown, structured data (via LLM Extract), screenshots, or raw HTML, making it versatile for analysis and integration with other AI applications.
Let’s have a look how the assistant CAMEL agent can answer our questions with the response from Firecrawl.
🔥 Firecrawl: To Map
Map: This feature takes a website as input and rapidly retrieves all associated URLs, providing a quick and comprehensive overview of the site’s structure. This high-speed mapping is ideal for efficient content discovery and organization.
🌟 Highlights
This notebook has guided you through streamlining the process of web data extraction and enhances your agents capabilities using Firecrawl within the CAMEL framework. With Firecrawl’s powerful features like Scrape, Crawl, and Map, you can efficiently gather content in formats ready for LLMs to use, directly feeding into CAMEL-AI’s multi-agent workflows. This setup not only simplifies data collection but also enables more intelligent and insightful agents.
Key tools utilized in this notebook include:
- CAMEL: A powerful multi-agent framework that enables Retrieval-Augmented Generation and multi-agent role-playing scenarios, allowing for sophisticated AI-driven tasks.
- Firecrawl: A data ingestion tool that streamlines web data extraction using web scraping, API access, and automated browser interactions.
That’s everything: Got questions about 🐫 CAMEL-AI? Join us on Discord! Whether you want to share feedback, explore the latest in multi-agent systems, get support, or connect with others on exciting projects, we’d love to have you in the community! 🤝
Check out some of our other work:
-
🐫 Creating Your First CAMEL Agent free Colab
-
Graph RAG Cookbook free Colab
-
🧑⚖️ Create A Hackathon Judge Committee with Workforce free Colab
-
🔥 3 ways to ingest data from websites with Firecrawl & CAMEL free Colab
-
🦥 Agentic SFT Data Generation with CAMEL and Mistral Models, Fine-Tuned with Unsloth free Colab
Thanks from everyone at 🐫 CAMEL-AI
⭐ Star us on GitHub, join our Discord, or follow us on X