Registry / llm-agents / firecrawl

firecrawl

JSON →
library4.40.0pypypi✓ verified 26d ago

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 firecrawl
INSTALL
IMPORT
SIG · FIRECRAWL
F
firecrawl
llm-agentspythonv4.40.0
Install
7.5s avg
Import
1840ms
Disk
47MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v4.40.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 1.938s · 46.8MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 7.5s · import 1.742s · 48MB
47MB installed
● package 47MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FirecrawlApp
✓ from firecrawl import FirecrawlApp

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.

import os from firecrawl import FirecrawlApp # Ensure you have your Firecrawl API key set as an environment variable api_key = os.environ.get('FIRECRAWL_API_KEY', '') if not api_key: print("Error: FIRECRAWL_API_KEY environment variable not set.") print("Please set FIRECRAWL_API_KEY to your Firecrawl API key.") exit(1) try: app = FirecrawlApp(api_key=api_key) # Scrape a URL url_to_scrape = "https://www.firecrawl.ai/" print(f"Scraping: {url_to_scrape}") scraped_data = app.scrape(url_to_scrape) print("Scrape successful!") # Access the content from the 'data' field, which is a list of results if scraped_data and isinstance(scraped_data, dict) and 'data' in scraped_data and scraped_data['data']: first_item = scraped_data['data'][0] print(f"Title: {first_item.get('metadata', {}).get('title', 'N/A')}") print(f"Text content length: {len(first_item.get('content', ''))}") else: print("No data found in scrape result.") # Example: Crawl a website (optional, might take longer and consume more credits) # print(f"\nCrawling: {url_to_scrape} up to 1 page") # crawled_data = app.crawl(url_to_scrape, params={'limit': 1}) # if crawled_data and 'data' in crawled_data: # print(f"Crawled {len(crawled_data['data'])} pages.") except Exception as e: print(f"An error occurred: {e}")
Debug
Known issues
breakingThe library's package name changed from `firecrawl-py` to `firecrawl` with version 3.0.0. Projects using the older `firecrawl-py` will need to update their `pip install` command and import paths.
fix
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`.
affects: 3.0.0+
breakingVersion 3.0.0 introduced a complete rewrite of the SDK to align with the new Firecrawl API structure. This may lead to changes in method signatures, available parameters, and the structure of API responses, even for seemingly similar operations like `scrape` or `crawl`.
fix
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.
affects: 3.0.0+
gotchaA valid Firecrawl API key is mandatory for all API calls. Requests made without a properly configured API key will result in authentication errors or failed operations.
fix
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.
affects: All versions
gotchaFirecrawl API usage consumes credits. Be aware of the unified billing model (implemented on the API side) where various operations, including scrapes, crawls, and interactions, deduct from your account credits.
fix
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.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'firecrawl'
The 'firecrawl' Python package is not installed in your current environment.
fix
Run `pip install firecrawl-py` to install the library.
AttributeError: 'FirecrawlApp' object has no attribute 'scrape_url'
The method name `scrape_url` was deprecated and renamed to `scrape` in a breaking change for Firecrawl SDK versions 4.6.0 and higher.
fix
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`.
401 Unauthorized: Invalid API key
The API key provided is either missing, incorrect, revoked, or not properly formatted in the Authorization header.
fix
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.
400 Bad Request / Invalid input data. / Invalid url
This error occurs when the URL provided for scraping or crawling is malformed, not publicly accessible, or contains invalid characters, or other required parameters are missing/incorrect.
fix
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.
ImportError: cannot import name 'FirecrawlApp' from partially initialized module 'firecrawl' (most likely due to a circular import)
You likely have a Python file named `firecrawl.py` in your project directory, which conflicts with the installed `firecrawl` package, causing a circular import when you try to import `FirecrawlApp`.
fix
Rename your Python file to something other than `firecrawl.py` (e.g., `my_scraper.py`) to avoid name collision with the library.
Upgrade
Version history
4.40.0latest on PyPI · released Aug 26, 2026
Audit
Dependencies
requestsrequiredUsed for making HTTP requests to the Firecrawl API.
pydanticrequiredUsed for data validation and parsing API responses into Python objects.
Agent activity
30 hits · last 30 days
node
26
OpenAI (training)
1
Resources
firecrawl — pip install firecrawl · libregistry