Crawl
Firecrawl can recursively search through a urls subdomains, and gather the content
Firecrawl thoroughly crawls websites, ensuring comprehensive data extraction while bypassing any web blocker mechanisms. Here’s how it works:
-
URL Analysis: Begins with a specified URL, identifying links by looking at the sitemap and then crawling the website. If no sitemap is found, it will crawl the website following the links.
-
Recursive Traversal: Recursively follows each link to uncover all subpages.
-
Content Scraping: Gathers content from every visited page while handling any complexities like JavaScript rendering or rate limits.
-
Result Compilation: Converts collected data into clean markdown or structured output, perfect for LLM processing or any other task.
This method guarantees an exhaustive crawl and data collection from any starting URL.
Crawling
/crawl endpoint
Used to crawl a URL and all accessible subpages. This submits a crawl job and returns a job ID to check the status of the crawl.
allowBackwardLinks
parameterInstallation
Usage
Response
If you’re using cURL or async crawl
functions on SDKs, this will return an ID
where you can use to check the status of the crawl.
Check Crawl Job
Used to check the status of a crawl job and get its result.
Response Handling
The response varies based on the crawl’s status.
For not completed or large responses exceeding 10MB, a next
URL parameter is provided. You must request this URL to retrieve the next 10MB of data. If the next
parameter is absent, it indicates the end of the crawl data.
The skip parameter sets the maximum number of results returned for each chunk of results returned.
The skip and next parameter are only relavent when hitting the api directly. If you’re using the SDK, we handle this for you and will return all the results at once.
Crawl WebSocket
Firecrawl’s WebSocket-based method, Crawl URL and Watch
, enables real-time data extraction and monitoring. Start a crawl with a URL and customize it with options like page limits, allowed domains, and output formats, ideal for immediate data processing needs.
Crawl Webhook
You can now pass a webhook
parameter to the /crawl
endpoint. This will send a POST request to the URL you specify when the crawl is started, updated and completed.
The webhook will now trigger for every page crawled and not just the whole result at the end.
Webhook Events
There are now 4 types of events:
crawl.started
- Triggered when the crawl is started.crawl.page
- Triggered for every page crawled.crawl.completed
- Triggered when the crawl is completed to let you know it’s done (Beta)**crawl.failed
- Triggered when the crawl fails.
Webhook Response
success
- If the webhook was successful in crawling the page correctly.type
- The type of event that occurred.id
- The ID of the crawl.data
- The data that was scraped (Array). This will only be non empty oncrawl.page
and will contain 1 item if the page was scraped successfully. The response is the same as the/scrape
endpoint.error
- If the webhook failed, this will contain the error message.
**Beta consideration
- There is a very tiny chance that the
crawl.completed
event may be triggered while the finalcrawl.page
events are still being processed. We’re working on a fix for this.