Firecrawl Java Source of Truth
This file is the canonical public source of truth for agents. It is generated from the Firecrawl Java SDK source and the v2 OpenAPI spec.Install
Maven:Authenticate
When To Use What
search: start from a query to discover relevant URLs, includingsite:constraints.scrape: fetch and extract content from a known URL.interact: run browser actions or code when a page needs clicks, forms, or post-scrape steps.
Search
Why use it
Use search when you need discovery from a query and want Firecrawl to return URLs (and optionally scrape each result). You can constrain results to a domain with the standardsite: operator, for example site:docs.firecrawl.dev crawl webhooks.
Preferred SDK method
client.search(query, options)
Simple Example
Complex Example
Parameters
| Parameter | Type / Options | Description |
|---|---|---|
query | String | Search query. Use site:domain to restrict results to a site. |
options.sources | List<Object> ("web", "news", "images" or {type: "web"} maps) | Sources to search. |
options.categories | List<Object> ("github", "research", "pdf") | Categories to filter results. |
options.limit | Integer | Maximum number of results to return. |
options.tbs | String | Time-based search filter (for example qdr:d, qdr:w, sbd:1,qdr:m). |
options.location | String | Location string for search results. |
options.ignoreInvalidURLs | Boolean | Exclude invalid URLs that other Firecrawl endpoints cannot scrape. |
options.timeout | Integer | Timeout in milliseconds. |
options.scrapeOptions | ScrapeOptions | Scrape options applied to each result (same fields as scrape). |
options.integration | String | Internal only. Reserved for Firecrawl instrumentation. |
Scrape
Why use it
Use scrape when you already have a URL and want Firecrawl to return structured content and optional formats.Preferred SDK method
client.scrape(url, options)
Simple Example
Complex Example
Parameters
| Parameter | Type / Options | Description |
|---|---|---|
url | String | URL to scrape. |
options.formats | List<Object> | Output formats to include. Strings or format objects such as {type: "json", prompt, schema} or {type: "screenshot", fullPage, quality, viewport}. |
options.headers | Map<String, String> | Custom headers. |
options.includeTags | List<String> | Tags to include. |
options.excludeTags | List<String> | Tags to exclude. |
options.onlyMainContent | Boolean | Keep only the main content. |
options.timeout | Integer | Timeout in milliseconds. |
options.waitFor | Integer | Wait time in milliseconds before scraping. |
options.mobile | Boolean | Emulate a mobile device. |
options.parsers | List<Object> | Parser configuration (PDF options supported). |
options.actions | List<Map<String, Object>> | Browser actions to run before scraping. |
options.location | LocationConfig | Location settings for the request. |
options.skipTlsVerification | Boolean | Skip TLS certificate verification. |
options.removeBase64Images | Boolean | Strip base64 images from markdown output. |
options.blockAds | Boolean | Enable ad and cookie popup blocking. |
options.proxy | String ("basic", "stealth", "enhanced", "auto", or a custom URL) | Proxy mode. |
options.maxAge | Long | Prefer cached data up to this age. |
options.storeInCache | Boolean | Store results in cache. |
options.integration | String | Internal only. Reserved for Firecrawl instrumentation. |
Interact
Why use it
Use interact when a page requires browser actions or code execution after a scrape starts (clicks, forms, or scripted steps).Preferred SDK method
client.interact(jobId, code, language, timeout, origin)
Simple Example
Complex Example
Parameters
| Parameter | Type / Options | Description |
|---|---|---|
jobId | String | Scrape job ID from document.metadata.scrapeId. |
code | String | Code to execute in the browser session. |
language | String ("python", "node", "bash") | Execution language. Defaults to node when omitted. |
timeout | Integer | Execution timeout in seconds (1-300). |
origin | String | Internal only. Reserved for Firecrawl instrumentation. |
Notes
- The Java SDK interact API only supports
code. Other SDKs exposepromptas a convenience. - Deprecated alias:
scrapeExecutemaps tointeract, anddeleteScrapeBrowsermaps tostopInteractiveBrowser.
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/LocationConfig.javafirecrawl/apps/java-sdk/src/main/java/com/firecrawl/models/JsonFormat.javafirecrawl/apps/java-sdk/src/main/java/com/firecrawl/models/Document.javafirecrawl-docs/api-reference/v2-openapi.json

