Pull requestsfirecrawl #4839
 

fix(python-sdk): forward robots_user_agent from crawl and start_crawl

 
RA
7d ago
+53+53+01234567890123456789-0-0-0123456789

Summary

FirecrawlClient.crawl and FirecrawlClient.start_crawl list every crawl option explicitly, but robots_user_agent is missing. CrawlRequest and _prepare_crawl_request already support it (mapped to robotsUserAgent), and the async client forwards it through **kwargs, so only the sync wrappers reject it with a TypeError.

The change adds the keyword-only parameter to both methods, documents it, and passes it into the CrawlRequest. When the argument is unset, it is dropped from the payload as before.

Test plan

  • Added test_crawl_client_options.py with tests that check the request body sent by start_crawl and crawl, and that robotsUserAgent is absent when the argument is unset.
  • Before the change, 2 of the 3 new tests fail with TypeError. After the change all 3 pass, and the SDK unit suite passes (559 passed).

Command: python -m pytest firecrawl/__tests__/unit -q from apps/python-sdk.


Summary by cubic

Fixes FirecrawlClient.crawl and FirecrawlClient.start_crawl rejecting the robots_user_agent option. The parameter is now accepted, documented, and forwarded to the request body, matching the existing async client behavior. Adds unit tests verifying the option is sent and omitted when unset.

Reviewers

No reviewers yet

Checks

No check runs

No renderable file diffs available.