Canonical Firecrawl Java source of truth for agents. Generated from SDK source and the v2 OpenAPI spec.Documentation Index
Fetch the complete documentation index at: https://docs.firecrawl.dev/llms.txt
Use this file to discover all available pages before exploring further.
Install
Maven:Authenticate
When To Use What
search: use when you start with a query and need discovery.scrape: use when you already have a URL and want page content.interact: use when the page needs clicks, forms, or post-scrape browser actions.
Search
Why use it
Use search to discover relevant pages from a query, then pick URLs to scrape or interact with. You can constrain results to a site withsite:, for example site:docs.firecrawl.dev crawl webhooks.
Preferred SDK methods
client.search(query)client.search(query, options)
Return value
search returns SearchData. Read result buckets with getWeb(), getNews(), and getImages() (each is List<Map<String, Object>> and may be null). Do not treat SearchData as a directly iterable list of hits.
Simple Example
Complex Example
Parameters
-
query- Type: String
- Use when: you need a search query.
- Notes: use
site:example.comto limit results to a domain.
-
options.sources- Type: List of source strings or maps
- Use when: you want to control which sources are searched.
- Confirmed values:
"web": web index results"news": news results"images": image results{type: "web" | "news" | "images"}: typed source map form
-
options.categories- Type: List of category strings or maps
- Use when: you want to filter results by category.
- Confirmed values:
"github": GitHub-focused results"research": research and academic results"pdf": PDF-focused results{type: "github" | "research" | "pdf"}: typed category map form
-
options.limit- Type: Integer
- Use when: you want to cap results.
-
options.tbs- Type: String
- Use when: you need a time-based filter (for example
qdr:d,qdr:w,sbd:1,qdr:m).
-
options.location- Type: String
- Use when: you want localized results.
-
options.ignoreInvalidURLs- Type: Boolean
- Use when: you want to drop URLs that cannot be scraped by other endpoints.
-
options.timeout- Type: Integer
- Use when: you need a request timeout in milliseconds.
-
options.scrapeOptions- Type:
ScrapeOptions - Use when: you want to scrape each search result (see Scrape parameters for fields).
- Type:
-
options.integration- Type: String
- Use when: the API expects an integration identifier on the request.
Scrape
Why use it
Use scrape when you already have a URL and want structured content in one or more formats.Preferred SDK methods
client.scrape(url)client.scrape(url, options)
Return value
scrape returns Document. Typical getters include getMarkdown(), getHtml(), getRawHtml(), getJson(), getMetadata(), getLinks(), and additional fields when the corresponding formats are requested.
Simple Example
Complex Example
Parameters
-
url- Type: String
- Use when: you want to scrape a specific page.
-
options.formats- Type: List of format strings or format maps
- Use when: you want multiple output formats.
- Confirmed format strings:
"markdown": markdown content"html": cleaned HTML"rawHtml": raw HTML"links": page links"images": image URLs"screenshot": screenshot output"summary": summary output"changeTracking": change tracking output"json": JSON extraction"attributes": attribute extraction"branding": branding profile output"audio": audio extraction
- Format object fields:
type: one of the format strings aboveprompt,schema: JSON extraction options fortype: "json"modes,schema,prompt,tag: change tracking options fortype: "changeTracking"fullPage,quality,viewport: screenshot options fortype: "screenshot"selectors: array of{selector, attribute}fortype: "attributes"
-
options.headers- Type:
Map<String, String> - Use when: you need custom request headers.
- Type:
-
options.includeTags- Type:
List<String> - Use when: you want to include only specific HTML tags.
- Type:
-
options.excludeTags- Type:
List<String> - Use when: you want to exclude specific HTML tags.
- Type:
-
options.onlyMainContent- Type: Boolean
- Use when: you want to strip nav, footer, and other boilerplate.
-
options.timeout- Type: Integer
- Use when: you need a timeout in milliseconds.
-
options.waitFor- Type: Integer
- Use when: you need to wait for the page to render (milliseconds).
-
options.mobile- Type: Boolean
- Use when: you want a mobile viewport.
-
options.parsers- Type:
List<Object> - Use when: you need file parsing controls.
- Confirmed values:
"pdf"{type: "pdf", maxPages: number}
- Type:
-
options.actions- Type:
List<Map<String, Object>> - Use when: you need lightweight pre-scrape actions.
- Confirmed action types:
wait:millisecondsorselectorrequiredscreenshot:fullPage,quality,viewportoptionalclick:selectorrequiredwrite:textrequired (click to focus the input first)press:keyrequiredscroll:direction(upordown) required,selectoroptionalscrape: no additional fieldsexecuteJavascript:scriptrequiredpdf:format(A0, A1, A2, A3, A4, A5, A6, Letter, Legal, Tabloid, Ledger),landscape,scaleoptional
- Type:
-
options.location- Type:
LocationConfig - Use when: you need geo or language-aware scraping.
- Type:
-
options.skipTlsVerification- Type: Boolean
- Use when: you need to skip TLS verification.
-
options.removeBase64Images- Type: Boolean
- Use when: you want to drop base64 images from markdown output.
-
options.blockAds- Type: Boolean
- Use when: you want ad and cookie popup blocking.
-
options.proxy- Type: String
- Use when: you need proxy control.
- Confirmed values:
"basic","stealth","enhanced","auto", or a custom proxy URL string
-
options.maxAge- Type: Long
- Use when: you want cached data up to a maximum age (milliseconds).
-
options.storeInCache- Type: Boolean
- Use when: you want Firecrawl to cache the result.
-
options.integration- Type: String
- Use when: the API expects an integration identifier on the request.
Interact
Why use it
Use interact when a page requires browser actions or code execution after a scrape starts.Preferred SDK methods
client.interact(jobId, code)— uses default languagenodeand API default execution timeoutclient.interact(jobId, code, language, timeout)—timeoutis seconds (1–300), or null to omit and use the API default (30 seconds)client.interact(jobId, code, language, timeout, origin)— optionaloriginstring is sent only when non-null (request attribution)
Simple Example
Complex Example
Stop interactive browser
End the scrape-bound browser session when finished. Preferred SDK method:client.stopInteractiveBrowser(jobId)
Interact response (BrowserExecuteResponse)
isSuccess(): booleangetStdout(),getStderr(),getResult(),getError(): String (may be null)getExitCode(): Integer (may be null)getKilled(): Boolean (may be null) — true when execution was stopped due to timeout
Stop response (BrowserDeleteResponse)
isSuccess(): booleangetSessionDurationMs(): Long (may be null)getCreditsBilled(): Integer (may be null)getError(): String (may be null)
Parameters
-
jobId- Type: String
- Use when: you have a scrape job ID.
-
code- Type: String
- Use when: you want to run code in the browser session.
-
language- Type: String
- Use when: you need a specific runtime.
- Confirmed values:
"python","node","bash" - Notes: defaults to
"node"in the SDK if null.
-
timeout- Type: Integer
- Use when: you need an execution timeout in seconds (1–300). Null omits the field and uses the API default.
-
origin- Type: String
- Use when: you need an optional origin label on the request. Prefer omitting unless your integration requires it.
Notes
- Deprecated aliases:
scrapeExecute→interact,deleteScrapeBrowser→stopInteractiveBrowser(and the corresponding*Asynchelpers). - The Java SDK exposes code-based interactions only: there is no
promptparameter oninteract(unlike some other language SDKs).
Source Of Truth
firecrawl/apps/java-sdk/build.gradle.ktsfirecrawl/apps/java-sdk/src/main/java/com/firecrawl/client/FirecrawlClient.javafirecrawl/apps/java-sdk/src/main/java/com/firecrawl/models/SearchOptions.javafirecrawl/apps/java-sdk/src/main/java/com/firecrawl/models/ScrapeOptions.javafirecrawl/apps/java-sdk/src/main/java/com/firecrawl/models/SearchData.javafirecrawl/apps/java-sdk/src/main/java/com/firecrawl/models/JsonFormat.javafirecrawl/apps/java-sdk/src/main/java/com/firecrawl/models/LocationConfig.javafirecrawl/apps/java-sdk/src/main/java/com/firecrawl/models/Document.javafirecrawl/apps/java-sdk/src/main/java/com/firecrawl/models/BrowserExecuteResponse.javafirecrawl/apps/java-sdk/src/main/java/com/firecrawl/models/BrowserDeleteResponse.javafirecrawl-docs/api-reference/v2-openapi.json

