PHPackages                             jpcaparas/laravel-firecrawl - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. jpcaparas/laravel-firecrawl

ActiveLibrary

jpcaparas/laravel-firecrawl
===========================

Interface with the Firecrawl API using Laravel

v0.1(1y ago)71.1k↓25%[3 PRs](https://github.com/jpcaparas/laravel-firecrawl/pulls)MITPHPPHP ^8.2||^8.3||^8.4CI passing

Since May 1Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/jpcaparas/laravel-firecrawl)[ Packagist](https://packagist.org/packages/jpcaparas/laravel-firecrawl)[ Docs](https://github.com/jpcaparas/laravel-firecrawl)[ RSS](/packages/jpcaparas-laravel-firecrawl/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (13)Versions (5)Used By (0)

Laravel Firecrawl API Client
============================

[](#laravel-firecrawl-api-client)

[![run-tests](https://github.com/jpcaparas/laravel-firecrawl/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/jpcaparas/laravel-firecrawl/actions/workflows/run-tests.yml)

[![PHPStan](https://github.com/jpcaparas/laravel-firecrawl/actions/workflows/phpstan.yml/badge.svg)](https://github.com/jpcaparas/laravel-firecrawl/actions/workflows/phpstan.yml)

A Laravel package for seamlessly integrating with the [Firecrawl API](https://firecrawl.dev), allowing you to turn entire websites into LLM-ready markdown and extract structured data using AI.

Features
--------

[](#features)

- **Extract** - Get structured data from web pages with AI
- **Crawl** - Scrape all URLs from a website and get their content in LLM-ready format
- **Map** - Input a website and get all its URLs extremely fast
- **Scrape** - Get content from a single URL in various formats
- **Search** - Perform web searches with the Firecrawl API

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require jpcaparas/laravel-firecrawl
```

You can publish the config file with:

```
php artisan vendor:publish --tag="laravel-firecrawl-config"
```

Configuration
-------------

[](#configuration)

Add your Firecrawl API key to your `.env` file:

```
FIRECRAWL_API_KEY=your_api_key_here

```

You can obtain an API key by signing up at [Firecrawl](https://firecrawl.dev).

Usage
-----

[](#usage)

### Using the Facade

[](#using-the-facade)

```
use JPCaparas\LaravelFirecrawl\Facades\LaravelFirecrawl;

// Extract structured data from URLs
$result = LaravelFirecrawl::extract()->extract(
    ['https://example.com'],
    'Extract company information',
    [
        'type' => 'object',
        'properties' => [
            'company_name' => ['type' => 'string'],
            'description' => ['type' => 'string']
        ]
    ]
);

// Get extraction results using the job ID
$extractionResults = LaravelFirecrawl::extract()->getExtractionStatus($result['id']);
```

### Using Dependency Injection

[](#using-dependency-injection)

```
use JPCaparas\LaravelFirecrawl\LaravelFirecrawl;

public function __construct(protected LaravelFirecrawl $firecrawl)
{
    // Constructor injection
}

public function extractData()
{
    $result = $this->firecrawl->extract()->extract(
        ['https://example.com'],
        'Extract company information',
        [
            'type' => 'object',
            'properties' => [
                'company_name' => ['type' => 'string'],
                'description' => ['type' => 'string']
            ]
        ]
    );

    return $result;
}
```

### Available Services

[](#available-services)

#### Extract Service

[](#extract-service)

```
// Extract data from URLs using AI
$result = LaravelFirecrawl::extract()->extract(
    ['https://example.com'],
    'Extract company information',
    [
        'type' => 'object',
        'properties' => [
            'company_name' => ['type' => 'string'],
            'description' => ['type' => 'string']
        ]
    ],
    true // Enable web search (optional)
);

// Get extraction status and results
$status = LaravelFirecrawl::extract()->getExtractionStatus($result['id']);
```

#### Crawl Service

[](#crawl-service)

```
// Crawl a website
$result = LaravelFirecrawl::crawl()->crawl('https://example.com', [
    'maxDepth' => 3,
    'allowExternalLinks' => false
]);

// Get crawl status and results
$status = LaravelFirecrawl::crawl()->getCrawlStatus($result['id']);
```

#### Map Service

[](#map-service)

```
// Map a website to get all URLs
$result = LaravelFirecrawl::map()->map('https://example.com', [
    'maxDepth' => 2
]);
```

#### Scrape Service

[](#scrape-service)

```
// Scrape a single URL
$result = LaravelFirecrawl::scrape()->scrape('https://example.com', [
    'outputFormat' => 'markdown',
    'includeScreenshot' => true
]);
```

#### Search Service

[](#search-service)

```
// Search the web
$result = LaravelFirecrawl::search()->search('search query', [
    'limit' => 10
]);
```

### Command Line

[](#command-line)

You can view information about the Firecrawl API client using the included command:

```
php artisan firecrawl:info
```

This command displays:

- API key status
- Available services
- Usage examples

#### Extract Commands

[](#extract-commands)

Extract structured data from web pages with AI:

```
php artisan firecrawl:extract --urls=https://en.wikipedia.org/wiki/WD-40 --prompt="Extract product information" --schema='{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}}}'
```

Options:

- `--urls` - Array of URLs to extract data from (can be specified multiple times)
- `--urls-from-file` - Path to a file containing URLs, one per line
- `--prompt` - The prompt to guide the extraction
- `--prompt-from-file` - Path to a file containing the prompt text
- `--schema` - JSON schema for structuring the extracted data (inline JSON)
- `--schema-from-file` - Path to a JSON file containing the schema
- `--config-file` - Path to a JSON configuration file containing all extract parameters
- `--web-search` - Enable web search capability
- `--output` - Save results to specified file path

Check the status of an extraction job:

```
php artisan firecrawl:extract-status {id} --wait
```

Options:

- `--wait` - Wait for the extraction to complete
- `--poll-interval` - Seconds to wait between status checks when using --wait
- `--output` - Save results to specified file path

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance70

Regular maintenance activity

Popularity25

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

383d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2406808?v=4)[JP Caparas](/maintainers/jpcaparas)[@jpcaparas](https://github.com/jpcaparas)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")[![jpcaparas](https://avatars.githubusercontent.com/u/2406808?v=4)](https://github.com/jpcaparas "jpcaparas (1 commits)")

---

Tags

laravelextractcrawlscrapellmweb-scraping firecrawl

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/jpcaparas-laravel-firecrawl/health.svg)

```
[![Health](https://phpackages.com/badges/jpcaparas-laravel-firecrawl/health.svg)](https://phpackages.com/packages/jpcaparas-laravel-firecrawl)
```

###  Alternatives

[spatie/laravel-site-search

A site search engine

300129.1k](/packages/spatie-laravel-site-search)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[spatie/laravel-prometheus

Export Laravel metrics to Prometheus

2651.3M6](/packages/spatie-laravel-prometheus)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
