firecrawl 1.13.5__tar.gz → 1.14.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of firecrawl might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: firecrawl
3
- Version: 1.13.5
3
+ Version: 1.14.1
4
4
  Summary: Python SDK for Firecrawl API
5
5
  Home-page: https://github.com/mendableai/firecrawl
6
6
  Author: Mendable.ai
@@ -13,7 +13,7 @@ import os
13
13
 
14
14
  from .firecrawl import FirecrawlApp # noqa
15
15
 
16
- __version__ = "1.13.5"
16
+ __version__ = "1.14.1"
17
17
 
18
18
  # Define the logger for the Firecrawl project
19
19
  logger: logging.Logger = logging.getLogger("firecrawl")
@@ -37,7 +37,7 @@ def test_scrape_url_invalid_api_key():
37
37
  # assert "Unexpected error during scrape URL: Status code 403. Firecrawl currently does not support social media scraping due to policy restrictions. We're actively working on building support for it." in str(excinfo.value)
38
38
 
39
39
  def test_successful_response_with_valid_preview_token():
40
- app = FirecrawlApp(api_url=API_URL, api_key="this_is_just_a_preview_token", version='v0')
40
+ app = FirecrawlApp(api_url=API_URL, api_key=os.getenv('PREVIEW_TOKEN'), version='v0')
41
41
  response = app.scrape_url('https://roastmywebsite.ai')
42
42
  assert response is not None
43
43
  assert 'content' in response
@@ -49,7 +49,7 @@ def test_scrape_url_invalid_api_key():
49
49
  # assert "URL is blocked. Firecrawl currently does not support social media scraping due to policy restrictions." in str(excinfo.value)
50
50
 
51
51
  def test_successful_response_with_valid_preview_token():
52
- app = FirecrawlApp(api_url=API_URL, api_key="this_is_just_a_preview_token")
52
+ app = FirecrawlApp(api_url=API_URL, api_key=os.getenv('PREVIEW_TOKEN'))
53
53
  response = app.scrape_url('https://roastmywebsite.ai')
54
54
  assert response is not None
55
55
  assert "_Roast_" in response['markdown']
@@ -327,7 +327,7 @@ def test_invalid_api_key_on_map():
327
327
  # assert "URL is blocked. Firecrawl currently does not support social media scraping due to policy restrictions." in str(excinfo.value)
328
328
 
329
329
  def test_successful_response_with_valid_preview_token_on_map():
330
- app = FirecrawlApp(api_key="this_is_just_a_preview_token", api_url=API_URL)
330
+ app = FirecrawlApp(api_key=os.getenv('PREVIEW_TOKEN'), api_url=API_URL)
331
331
  response = app.map_url('https://roastmywebsite.ai')
332
332
  assert response is not None
333
333
  assert len(response) > 0
@@ -646,12 +646,12 @@ class FirecrawlApp:
646
646
  else:
647
647
  self._handle_error(response, "check batch scrape errors")
648
648
 
649
- def extract(self, urls: List[str], params: Optional[ExtractParams] = None) -> Any:
649
+ def extract(self, urls: Optional[List[str]] = None, params: Optional[ExtractParams] = None) -> Any:
650
650
  """
651
651
  Extracts information from a URL using the Firecrawl API.
652
652
 
653
653
  Args:
654
- urls (List[str]): The URLs to extract information from.
654
+ urls (Optional[List[str]]): The URLs to extract information from.
655
655
  params (Optional[ExtractParams]): Additional parameters for the extract request.
656
656
 
657
657
  Returns:
@@ -662,6 +662,9 @@ class FirecrawlApp:
662
662
  if not params or (not params.get('prompt') and not params.get('schema')):
663
663
  raise ValueError("Either prompt or schema is required")
664
664
 
665
+ if not urls and not params.get('prompt'):
666
+ raise ValueError("Either urls or prompt is required")
667
+
665
668
  schema = params.get('schema')
666
669
  if schema:
667
670
  if hasattr(schema, 'model_json_schema'):
@@ -678,6 +681,8 @@ class FirecrawlApp:
678
681
  'origin': 'api-sdk'
679
682
  }
680
683
 
684
+ if not request_data['urls']:
685
+ request_data['urls'] = []
681
686
  # Only add prompt and systemPrompt if they exist
682
687
  if params.get('prompt'):
683
688
  request_data['prompt'] = params['prompt']
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: firecrawl
3
- Version: 1.13.5
3
+ Version: 1.14.1
4
4
  Summary: Python SDK for Firecrawl API
5
5
  Home-page: https://github.com/mendableai/firecrawl
6
6
  Author: Mendable.ai
File without changes
File without changes
File without changes
File without changes
File without changes