| name | serving-the-api |
| description | Use when the user wants a long-running HTTP service for scrape/crawl/map instead of one-shot CLI calls or the MCP server — for example wiring crawlberg into other apps over REST. Covers `crawlberg serve`, the Firecrawl-v1-compatible endpoints, `--host`/`--port`, and when to prefer it. |
Serving the API
crawlberg serve starts a long-running REST API server exposing the crawl
engine over HTTP. The endpoints are Firecrawl v1-compatible, so existing
Firecrawl clients and SDKs can point at a local crawlberg instance.
This subcommand requires the binary to be built with the optional api
feature (non-default). The Homebrew tap is built with all features, so serve
is available there; a from-source build needs
cargo install crawlberg-cli --features api
(or --features all) to include it.
Quick recipe
crawlberg serve --host 127.0.0.1 --port 3000
It logs Starting REST API server on <host>:<port> to stderr and blocks until
terminated. Hit GET /health to confirm it is up.
Flags
| Flag | Default | Purpose |
|---|
--host | 0.0.0.0 | Address to bind to. |
--port | 3000 | Port to listen on. |
serve does not take the per-request crawl flags — it boots with the default
CrawlConfig and accepts per-request options in each HTTP request body.
Endpoints
Firecrawl v1 surface: