Skip to main content
The Firecrawl Java SDK provides a robust, type-safe interface for scraping, crawling, and extracting structured data from websites. It supports both synchronous and asynchronous operations with CompletableFuture.

Installation

Prerequisites

  • Java 11 or later
  • Gradle 8+ or Maven 3+

Quick Start

Authentication

Get your API key from firecrawl.dev and configure the client:

Scraping

Basic Scrape

Scrape a single URL:

Scrape with Options

JSON Extraction

Extract structured data using a schema:

Additional Formats

Crawling

Basic Crawl (Auto-Wait)

Crawl a website and automatically wait for completion:

Async Crawl (Manual Polling)

Start a crawl and poll manually:

Cancel a Crawl

Advanced Crawl Options

Agent

Use the AI agent to autonomously gather data from the web:

Agent with Schema

Agent with URLs

Model Selection

Map

Discover all URLs on a website:

Map with Options

Search the web and optionally scrape results:

Search with Content Scraping

Batch Scraping

Scrape multiple URLs in parallel:

Async Batch Scrape

Async Support

All methods have async variants that return CompletableFuture:

Usage & Metrics

Monitor API usage and concurrency:

Error Handling

The SDK throws unchecked exceptions for errors:

Configuration

Building from Source

Testing

Resources