crawlberg-serving-the-api
/crawlberg-serving-the-api
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.
- Author
- xberg-io ↗
- Repository
- crawlberg ↗
- Licence
- MIT
- Last repository change
- 27.10.2026
Assessment and security
- Files in this package
- 2
- Scripts
- 0
- HTML comments
- 1
- URLs in SKILL.md
- 7
No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- SKILL.md zawiera komentarze HTML (1). Nie widać ich w podglądzie Markdown, a model je czyta.
What it does and when to use it
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.
Original author 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.
How it works
- Quick recipe
- Flags
- Endpoints
- Examples
- Operational notes
- When to run serve vs. CLI vs. MCP
SKILL.md preview
---
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.
name: crawlberg-serving-the-api
---
<!--
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
Content-Hash: blake3:1985fa0ec5929f7949a6ffe17c9473bfef3221180eabd504f8ca01e3821d8618
Source-Hash: blake3:1dd3033fc093f9f97b422276c46ae9bb65cf343c6a36dc17597e0dfff108ab60
Schema-Version: v1
-->
# 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
```bash
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:
| Method + path | Purpose |
| ------------------------- | ---------------------------------------------------- |
| `POST /v1/scrape` | Scrape a single URL (synchronous). |
| `POST /v1/crawl` | Start an asynchronous crawl job → returns a job `id`. |
| `GET /v1/crawl/{id}` | Poll crawl job status and collect results. |
| `DELETE /v1/crawl/{id}` | Cancel a running crawl job. |
| `POST /v1/map` | Discover URLs on a site (synchronous). |
| `POST /v1/batch/scrape` | Start an asynchronous batch-scrape job → job `id`. |
| `GET /v1/batch/scrape/{id}` | Poll batch-scrape job status and results. |
| `POST /v1/download` | Download a document from a URL. |
Operational:
| Method + path | Purpose |
| ----------------- | ---------------------------------------- |
| `GET /health` | Health check (`{ status, version }`). |
| `GET /version` | Version information. |
| `GET /openapi.json` | OpenAPI schema for the whole surface. |
Request bodies use `camelCase` fields. Scrape/crawl/map mirror the CLI:
`url`, `formats`, `onlyMainContent`, `includeTags`/`excludeTags`, `timeout`
for scrape; `url`, `maxDepth`, `maxPages`, `includePaths`/`excludePaths` for
crawl; `url`, `limit`, `search` for map. Responses wrap data as
`{ success, data | error }`; async jobs return `{ success, id }` and are polled
for `{ status, total, completed, data, error }`.
## Examples
### Scrape via HTTP
```bash
curl -s http://127.0.0.1:3000/v1/scrape \
-H 'content-type: application/json' \
-d '{"url":"https://example.com","formats":["markdown"]}' | jq '.data'
```
### Start a crawl job and poll it
```bash
id=$(curl -s http://127.0.0.1:3000/v1/crawl \
-H 'content-type: application/json' \
-d '{"url":"https://example.com","maxDepth":2,"maxPages":100}' | jq -r '.id')
curl -s "http://127.0.0.1:3000/v1/crawl/$id" | jq '{status,completed,total}'
```
### Map URLs
```bash
curl -s http://127.0.0.1:3000/v1/map \
-H 'content-type: application/json' \
-d '{"url":"https://example.com","limit":500,"search":"docs"}' | jq '.data'
```
## Operational notes
- The server accepts CORS from any origin and ships **no built-in
authentication** — do not expose it on a public interface. Bind to
`127.0.0.1` for local use, or put it behind a reverse proxy / gateway that
enforces auth and rate limiting before exposing it more widely.
- Request bodies are capped at 10 MB and each request times out after 5
minutes.
- Crawl and batch-scrape are asynchronous: the POST returns a job `id`
immediately and you poll the `{id}` endpoint until `status` is `completed`,
`failed`, or `cancelled`.
## When to run serve vs. CLI vs. MCP
- **CLI** (`scrape`/`crawl`/`map`/`interact`) — one-shot jobs, shell pipelines,
scripting. No long-running process.
- **MCP** (`crawlberg mcp`) — driving the crawler from an AI agent harness
(Claude Code, Codex, Cursor, Gemini, opencode). Auto-registered by this
plugin; prefer it inside an agent.
- **serve** (`crawlberg serve`) — a persistent HTTP service for other
applications or non-agent clients that speak REST, or when you want
Firecrawl-v1 compatibility. Choose it when many callers need the crawler
over the network rather than one agent or one shell.
Files in this package (2)
- SKILL.md 5 KB
- index.md 1 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · xberg-io/crawlberg | 100 | MIT |
| xberg-io/crawlberg | 100 | MIT |
| xberg-io/crawlberg | 84 | MIT |
Identical content appears in 6 other GitHub folders. We show one copy with the highest score.
Database snapshot: 13.11.2026 · package version 28c56107cf5e (SHA-256 digest of the entire package)
Downloads in the last 30 days: 1 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 84crawlberg
Crawl, scrape, and convert websites to Markdown using the local crawlberg CLI and its MCP server. Use when the user wants to fetch a page, follow links across a domain, enumerate URLs, or drive a real browser. Covers installation, the subcommands (scrape, crawl, map, interact,… - 100crawlberg
Crawl, scrape, and convert websites to Markdown using the local crawlberg CLI and its MCP server. Use when the user wants to fetch a page, follow links across a domain, enumerate URLs, or drive a real browser. Covers installation, the subcommands (scrape, crawl, map, interact,… - 100firecrawl
Use Firecrawl for markdown-first web scraping, crawling, and site mapping. Use when: "firecrawl", "crawl docs", "scrape website to markdown", "map website", "rag crawl". - 86firecrawl
Firecrawl API integration with managed authentication. Scrape, crawl, map, and search web content. Use this skill when users want to extract content from websites, crawl entire sites, map URLs, or search the web. For other third party apps, use the api-gateway skill… - 100crw
Scrape, crawl, map, search, parse, and extract web data with fastCRW — the open-source, self-hostable Firecrawl alternative (single Rust binary, ~14 MB RAM, Firecrawl-compatible /v1 + /v2 API). Use whenever the user needs page content, site-wide extraction, URL discovery, web… - 84firecrawl
Scrape, search, crawl, map, parse, or interact with web pages via the firecrawl-cli binary, writing results to disk instead of streaming them into context. Actions: scrape, search, crawl, map, parse, interact, agent, monitor, developer, research, doctor, search-feedback,…