{"id":5767,"library":"firecrawl","title":"Firecrawl Python SDK","description":"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.","status":"active","version":"4.22.1","language":"python","source_language":"en","source_url":"https://github.com/firecrawl/firecrawl","tags":["web scraping","web crawling","api client","ai agents","llm tools","data extraction","headless browser"],"install":[{"cmd":"pip install firecrawl","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Used for making HTTP requests to the Firecrawl API.","package":"requests","optional":false},{"reason":"Used for data validation and parsing API responses into Python objects.","package":"pydantic","optional":false}],"imports":[{"symbol":"FirecrawlApp","correct":"from firecrawl import FirecrawlApp"}],"quickstart":{"code":"import os\nfrom firecrawl import FirecrawlApp\n\n# Ensure you have your Firecrawl API key set as an environment variable\napi_key = os.environ.get('FIRECRAWL_API_KEY', '')\n\nif not api_key:\n    print(\"Error: FIRECRAWL_API_KEY environment variable not set.\")\n    print(\"Please set FIRECRAWL_API_KEY to your Firecrawl API key.\")\n    exit(1)\n\ntry:\n    app = FirecrawlApp(api_key=api_key)\n    \n    # Scrape a URL\n    url_to_scrape = \"https://www.firecrawl.ai/\"\n    print(f\"Scraping: {url_to_scrape}\")\n    scraped_data = app.scrape(url_to_scrape)\n    \n    print(\"Scrape successful!\")\n    # Access the content from the 'data' field, which is a list of results\n    if scraped_data and isinstance(scraped_data, dict) and 'data' in scraped_data and scraped_data['data']:\n        first_item = scraped_data['data'][0]\n        print(f\"Title: {first_item.get('metadata', {}).get('title', 'N/A')}\")\n        print(f\"Text content length: {len(first_item.get('content', ''))}\")\n    else:\n        print(\"No data found in scrape result.\")\n\n    # Example: Crawl a website (optional, might take longer and consume more credits)\n    # print(f\"\\nCrawling: {url_to_scrape} up to 1 page\")\n    # crawled_data = app.crawl(url_to_scrape, params={'limit': 1})\n    # if crawled_data and 'data' in crawled_data:\n    #     print(f\"Crawled {len(crawled_data['data'])} pages.\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n","lang":"python","description":"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."},"warnings":[{"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`.","message":"The 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.","severity":"breaking","affected_versions":"3.0.0+"},{"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.","message":"Version 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`.","severity":"breaking","affected_versions":"3.0.0+"},{"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.","message":"A 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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"Firecrawl 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'4.22.1':46 'activ':51 'agent':31,66 'ai':30,65 'api':14,63 'browser':72 'client':10,64 'content':41 'crawl':19,62 'current':43 'data':33,69 'design':28 'develop':16,52 'dynam':40 'effici':25 'enabl':15 'extract':34,70 'firecrawl':1,5,13 'format':38 'frequent':54 'headless':71 'interact':21 'librari':49 'llm':67 'minor':55 'page':24 'patch':57 'provid':8 'python':2,6 'releas':58 'scrape':18,60 'sdk':3,7 'support':36 'task':35 'tool':68 'undergo':50 'various':37 'version':44 'web':23,59,61","created_at":"2026-04-14T05:06:13.399992+00:00","updated_at":"2026-04-16T15:02:08.284577+00:00","problems":[{"fix":"Run `pip install firecrawl-py` to install the library.","cause":"The 'firecrawl' Python package is not installed in your current environment.","error":"ModuleNotFoundError: No module named 'firecrawl'"},{"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`.","cause":"The method name `scrape_url` was deprecated and renamed to `scrape` in a breaking change for Firecrawl SDK versions 4.6.0 and higher.","error":"AttributeError: 'FirecrawlApp' object has no attribute 'scrape_url'"},{"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.","cause":"The API key provided is either missing, incorrect, revoked, or not properly formatted in the Authorization header.","error":"401 Unauthorized: Invalid API key"},{"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.","cause":"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.","error":"400 Bad Request / Invalid input data. / Invalid url"},{"fix":"Rename your Python file to something other than `firecrawl.py` (e.g., `my_scraper.py`) to avoid name collision with the library.","cause":"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`.","error":"ImportError: cannot import name 'FirecrawlApp' from partially initialized module 'firecrawl' (most likely due to a circular import)"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"4.40.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://firecrawl.dev","github":"https://github.com/firecrawl/firecrawl","docs":"https://docs.firecrawl.dev","changelog":null,"pypi":"https://pypi.org/project/firecrawl/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["llm-agents","data","http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-31","next_check":"2026-07-28","install_tag":null}}