PHPackages                             remind/crawl4ai-php-client - 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. [API Development](/categories/api)
4. /
5. remind/crawl4ai-php-client

ActiveProject[API Development](/categories/api)

remind/crawl4ai-php-client
==========================

v1.1.0(4w ago)00proprietaryPHPPHP &gt;=8.2CI passing

Since Jun 10Pushed 4w agoCompare

[ Source](https://github.com/remindgmbh/crawl4ai-php-client)[ Packagist](https://packagist.org/packages/remind/crawl4ai-php-client)[ RSS](/packages/remind-crawl4ai-php-client/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (9)Versions (6)Used By (0)

[![REMIND](https://camo.githubusercontent.com/d737a5224dc89d53aaa278ba6285f89078264a458fc27a626389fb582f4b22b7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f52454d494e442d626c61636b2e737667)](https://www.remind.de/)[![Symfony](https://camo.githubusercontent.com/568cd5baefe25ad88245a4093a677da0a9fe73d3800e770c766985eff420d5ec/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d626c75652e737667)](https://symfony.com/)[![Crawl4Ai](https://camo.githubusercontent.com/5487452b49d43d8c676297db9f6f376c609c69f5282f6155c243bb52c4bba340/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f437261776c3441692d3530666666662e737667)](https://docs.crawl4ai.com/)[![Experimental](https://camo.githubusercontent.com/8a2b23c7ee4c0be78554871dd1cc38cf900f9a875f82db433ba99c68e6c159fe/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4578706572696d656e74616c2d6666643433622e737667)](https://camo.githubusercontent.com/8a2b23c7ee4c0be78554871dd1cc38cf900f9a875f82db433ba99c68e6c159fe/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4578706572696d656e74616c2d6666643433622e737667)

crawl4ai-php-client
===================

[](#crawl4ai-php-client)

Symfony CLI tool to crawl sitemaps and generate JSON/Markdown output via [Crawl4AI](https://github.com/unclecode/crawl4ai) API endpoints.

⚠️ Experimental Status
----------------------

[](#️-experimental-status)

This project is **experimental** and under active development. The API and functionality may change without notice.

Overview
--------

[](#overview)

**crawl4ai-php-client** is a Symfony-based command-line application that **exclusively provides sitemap crawling functionality**. It reads XML sitemap files, extracts URLs, crawls each URL using the Crawl4AI service, and outputs the results as JSON files with optional compression.

Key Features
------------

[](#key-features)

- **Sitemap-Based Web Crawling**: Extract and crawl all URLs from XML sitemap files
- **JSON Output with Optional Compression**: Results are written to JSON files with optional gzip compression
- **Symfony Console Application**: Built on Symfony 7.4 framework for robust CLI handling
- **Crawl4AI Integration**: Leverages Crawl4AI API for advanced web crawling capabilities
- **Flexible Output Modes**:
    - Full crawl results with metadata
    - Markdown-only output (content extraction)
- **Configurable Options**:
    - Custom output file naming
    - Locale settings for crawling
    - HTTP request timeouts
    - Markdown-only extraction mode
    - Optional gzip compression
- **Docker Support**: Containerized setup with Alpine Linux base

Requirements
------------

[](#requirements)

- PHP &gt;= 8.2
- Symfony 7.4
- Crawl4AI service running and accessible
- Composer for dependency management

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

[](#installation)

### Via Composer

[](#via-composer)

```
composer install
```

### Docker

[](#docker)

```
docker build -t crawl4ai-php-client .
docker run -it crawl4ai-php-client php bin/console crawl4ai:sitemap
```

Usage
-----

[](#usage)

### Basic Command

[](#basic-command)

```
php bin/console crawl4ai:sitemap
```

**Arguments:**

- `sitemapUrl` - URL to the XML sitemap file (required)

### Options

[](#options)

- `--outputFileNamePrefix=` - Prefix for output JSON files (default: `crawl`)
- `--locale=` - Locale for crawling (default: `en-EN`)
- `--fileCompression` - Enable gzip compression for output files
- `--timeout=` - HTTP request timeout in seconds (default: 300)
- `--markdownOnly` - Output only markdown content without metadata

### Examples

[](#examples)

```
# Basic crawl
php bin/console crawl4ai:sitemap https://example.com/sitemap.xml

# With compression
php bin/console crawl4ai:sitemap https://example.com/sitemap.xml --fileCompression

# Markdown-only extraction with custom prefix
php bin/console crawl4ai:sitemap https://example.com/sitemap.xml \
  --outputFileNamePrefix=content \
  --markdownOnly

# Custom locale and timeout
php bin/console crawl4ai:sitemap https://example.com/sitemap.xml \
  --locale=de-DE \
  --timeout=600
```

Output
------

[](#output)

Results are saved to the `crawl/output/` directory with timestamped filenames:

- **Format**: `{prefix}-{domain}-{timestamp}.json`
- **Example**: `crawl-example.com-2026-06-05-14-30-45.json`
- **Compression**: With `--fileCompression`, files are saved as `.json.gz` and the uncompressed version is removed

Architecture
------------

[](#architecture)

### Core Components

[](#core-components)

- **`AbstractCrawlCommand`** - Base class providing:

    - Crawl4AI API integration
    - HTTP client handling
    - File output management with optional compression
    - Configurable crawler defaults (locale, timeout, content filters)
- **`CrawlSitemapXmlCommand`** - Implements sitemap-specific crawling:

    - XML sitemap parsing and URL extraction
    - Command-line interface with configurable options
    - JSON output generation with timing statistics

Environment Variables
---------------------

[](#environment-variables)

- `CRAWL4AI_BASE_URL` - Base URL for Crawl4AI API service (required)

Example `.env` file:

```
CRAWL4AI_BASE_URL=http://localhost:8000
```

Directory Structure
-------------------

[](#directory-structure)

```
.
├── bin/
│   └── console           # CLI entrypoint
├── config/               # Symfony configuration
├── crawl/
│   └── output/          # Generated JSON output files
├── public/              # Web root (if web access needed)
├── src/
│   ├── Command/         # Console commands
│   │   ├── AbstractCrawlCommand.php
│   │   └── CrawlSitemapXmlCommand.php
│   └── Kernel.php       # Symfony kernel
└── var/
    └── cache/           # Symfony cache files

```

Limitations
-----------

[](#limitations)

- **Sitemap-only crawling**: This tool only supports XML sitemap-based URL discovery. Direct URL crawling is not supported.
- **Dependency on Crawl4AI**: Requires a running Crawl4AI service instance
- **Single-domain operation**: Each crawl targets URLs from a single sitemap file

---

**Version**: Experimental
**Last Updated**: June 2026

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance94

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Every ~15 days

Total

2

Last Release

29d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8d03cd13f9debb6b3cac65176a1743811fc4f24f3d2bb20a4c324c006382f072?d=identicon)[remindgmbh](/maintainers/remindgmbh)

---

Top Contributors

[![doleh](https://avatars.githubusercontent.com/u/73342114?v=4)](https://github.com/doleh "doleh (12 commits)")

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/remind-crawl4ai-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/remind-crawl4ai-php-client/health.svg)](https://phpackages.com/packages/remind-crawl4ai-php-client)
```

###  Alternatives

[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M600](/packages/shopware-core)[oro/platform

Business Application Platform (BAP)

645143.5k116](/packages/oro-platform)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[forumify/forumify-platform

122.0k14](/packages/forumify-forumify-platform)[chameleon-system/chameleon-base

The Chameleon System core.

1028.7k5](/packages/chameleon-system-chameleon-base)

PHPackages © 2026

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