A FastAPI-based frontend for crawl4ai that provides a web interface and REST API for crawling websites and converting them to markdown format.
- Web interface for easy interaction
- REST API for programmatic access
- Recursive website crawling with configurable depth
- Automatic conversion of web pages to markdown format
- Background job processing with status tracking
- Results downloadable as ZIP archives
- Docker support for easy deployment
- Ensure you have Python 3.10+ and Poetry installed
- Clone the repository
- Install dependencies:
poetry install
- Ensure you have Docker installed
- Build the image:
docker build -t crawl4ai-frontend .
Or use docker-compose:
docker-compose up -d
poetry run uvicorn main:app --host 0.0.0.0 --port 8000
Then open http://localhost:8000 in your browser.
docker run -p 8000:8000 crawl4ai-frontend
Then open http://localhost:8000 in your browser.
POST /api/crawl
Request body:
{
"url": "https://example.com",
"limit": 10
}
Response:
{
"job_id": "uuid",
"status": "starting",
"progress": 0
}
GET /api/status/{job_id}
Response:
{
"job_id": "uuid",
"status": "processing|completed|failed",
"progress": 5,
"total_pages": 10,
"current_url": "https://example.com/page"
}
GET /api/download/{job_id}
Returns a ZIP file containing the crawled pages in markdown format.
- Python 3.10+
- FastAPI
- Crawl4AI
- aiofiles
- Poetry (for dependency management)
For development, additional dependencies can be installed:
poetry install --with dev
Development dependencies include:
- autopep8 (code formatting)
- djlint (HTML template linting)
This project is licensed under the MIT License - see the LICENSE file for details.