Firecrawl Java Agent Quickstart
This file is the canonical quickstart for external agents integrating with Firecrawl via the Java SDK. It is generated from SDK source and the OpenAPI spec.Install
Maven:Authenticate
When To Use What
search: Use when you start with a query and need to discover relevant pages across the web.scrape: Use when you already have a URL and want to extract page content (markdown, HTML, structured data, etc.).interact: Use when the page needs clicks, form fills, or post-scrape browser actions via code execution.
Search
Why use it
Search finds relevant web pages for a query. Optionally scrapes each result in the same call viascrapeOptions.
Preferred SDK method
Example
Parameters
AllSearchOptions fields are nullable, set via builder.
Returns:
SearchData with getWeb(), getNews(), getImages() lists.
Async: client.searchAsync(query, options) returns CompletableFuture<SearchData>.
Scrape
Why use it
Scrape extracts content from a single URL in any format: markdown, HTML, structured JSON, screenshots, and more.Preferred SDK method
Example
Parameters
AllScrapeOptions fields are nullable, set via builder.
Returns:
Document with getMarkdown(), getHtml(), getRawHtml(), getJson(), getSummary(), getMetadata(), getLinks(), getImages(), getScreenshot(), getAudio(), getVideo(), getActions(), getWarning(), getChangeTracking(), getBranding(), getProduct(), getMenu(), getPages(), getBlocks().
Async: client.scrapeAsync(url, options) returns CompletableFuture<Document>.
Interact
Why use it
Interact lets you execute code in a browser session that was started by a scrape. Use it for post-scrape actions like clicking buttons, filling forms, or extracting dynamic content.Preferred SDK method
Example
Parameters
Returns:
BrowserExecuteResponse with isSuccess(), getStdout(), getResult(), getStderr(), getExitCode(), isKilled(), getError().
Related: client.stopInteractiveBrowser(jobId) ends the browser session.
Async: client.interactAsync(jobId, code, ...) returns CompletableFuture<BrowserExecuteResponse>.
Notes
- All parameter names use camelCase (e.g.
onlyMainContent,skipTlsVerification). - The Java SDK’s
interactmethod takescodeas a required parameter. Thepromptparameter (natural-language browser instructions) is not yet available in the Java SDK — use the Node.js or Python SDK for prompt-based interaction. - Deprecated aliases (use the preferred names instead):
scrapeExecute()→interact()deleteScrapeBrowser()→stopInteractiveBrowser()searchGitHub()→ deprecated (sunset 2026-11-03)
- Every method has a corresponding
*Asyncvariant returningCompletableFuture.
Source Of Truth
firecrawl/apps/java-sdk/src/main/java/com/firecrawl/client/FirecrawlClient.javafirecrawl-docs/api-reference/v2-openapi.json

