The Firecrawl Python SDK provides a client for the Firecrawl API, enabling developers to scrape, crawl, and interact with web pages efficiently. It's designed for AI agents and data extraction tasks, supporting various formats and dynamic content. The current version is 4.22.1, and the library undergoes active development with frequent minor and patch releases.
pip install firecrawlVerified import paths — ran on the pinned version, not inferred.
Initialize the FirecrawlApp client with your API key and perform a basic scrape operation. The example includes error handling for missing API keys and demonstrates accessing the scraped content from the API response.
Uninstall the old package (`pip uninstall firecrawl-py`), then install the new one (`pip install firecrawl`). Update import statements from `from firecrawl_py import FirecrawlApp` to `from firecrawl import FirecrawlApp`.
Thoroughly review the official Firecrawl Python SDK documentation for versions 3.0.0 and above, paying close attention to specific API endpoint usage, parameter options, and the expected format of returned data.
Set the `FIRECRAWL_API_KEY` environment variable with your key, or pass it directly to the `FirecrawlApp` constructor: `FirecrawlApp(api_key="YOUR_KEY")`. Obtain your API key from the Firecrawl dashboard.
Monitor your credit usage via the Firecrawl dashboard. Optimize your API calls by using parameters like `pageActions`, `limit`, `onlyMainContent`, `screenshot=False`, or specific extractors to minimize unnecessary processing and credit consumption.
Run `pip install firecrawl-py` to install the library.
Update your code to use `app.scrape()` instead of `app.scrape_url()`. If you're using an older SDK, consider updating the library with `pip install --upgrade firecrawl-py`.
Ensure your `api_key` is correct, starts with `fc-`, and is passed to the `FirecrawlApp` constructor, or set as the `FIRECRAWL_API_KEY` environment variable. Verify your API key in the Firecrawl dashboard.
Double-check the URL for typos, ensure it's a valid and publicly accessible link, and confirm all required parameters for the API call are correctly provided according to the Firecrawl documentation.
Rename your Python file to something other than `firecrawl.py` (e.g., `my_scraper.py`) to avoid name collision with the library.