Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

feat(python-sdk): implement missing crawl_entire_domain parameter (#1896)

devin-ai-integration[bot]269c7097cba9
diff --git a/apps/python-sdk/firecrawl/__tests__/v1/e2e_withAuth/test.py b/apps/python-sdk/firecrawl/__tests__/v1/e2e_withAuth/test.py
index db7301fe3..615655651 100644
--- a/apps/python-sdk/firecrawl/__tests__/v1/e2e_withAuth/test.py
+++ b/apps/python-sdk/firecrawl/__tests__/v1/e2e_withAuth/test.py
@@ -5,6 +5,7 @@ import os
from uuid import uuid4
from dotenv import load_dotenv
from datetime import datetime
+from firecrawl.firecrawl import SearchParams
load_dotenv()
@@ -249,6 +250,21 @@ def test_crawl_url_with_idempotency_key_e2e():
app.crawl_url('https://firecrawl.dev', {'excludePaths': ['blog/*']}, True, 2, uniqueIdempotencyKey)
assert "Idempotency key already used" in str(excinfo.value)
+def test_crawl_url_with_crawl_entire_domain():
+ app = FirecrawlApp(api_url=API_URL, api_key=TEST_API_KEY)
+ response = app.crawl_url(
+ 'https://roastmywebsite.ai',
+ crawl_entire_domain=True,
+ limit=3,
+ poll_interval=2
+ )
+ assert response is not None
+ assert 'total' in response
+ assert response['total'] > 0
+ assert 'status' in response
+ assert response['status'] == 'completed'
+ assert len(response['data']) > 0
+
def test_check_crawl_status_e2e():
app = FirecrawlApp(api_url=API_URL, api_key=TEST_API_KEY)
response = app.crawl_url('https://firecrawl.dev', {'scrapeOptions': {'formats': ['markdown', 'html', 'rawHtml', 'screenshot', 'links']}}, False)
diff --git a/apps/python-sdk/firecrawl/firecrawl.py b/apps/python-sdk/firecrawl/firecrawl.py
index 86a32a1fd..df415d4ce 100644
--- a/apps/python-sdk/firecrawl/firecrawl.py
+++ b/apps/python-sdk/firecrawl/firecrawl.py
@@ -264,6 +264,7 @@ class CrawlParams(pydantic.BaseModel):
maxDiscoveryDepth: Optional[int] = None
limit: Optional[int] = None
allowBackwardLinks: Optional[bool] = None
+ crawlEntireDomain: Optional[bool] = None
allowExternalLinks: Optional[bool] = None
ignoreSitemap: Optional[bool] = None
scrapeOptions: Optional[ScrapeOptions] = None
@@ -1161,6 +1162,7 @@ class FirecrawlApp:
max_discovery_depth=max_discovery_depth,
limit=limit,
allow_backward_links=allow_backward_links,
+ crawl_entire_domain=crawl_entire_domain,
allow_external_links=allow_external_links,
ignore_sitemap=ignore_sitemap,
scrape_options=scrape_options,