Configuration & CLI

Configure Crawlingo sessions via JSON/TOML files, CRAWLINGO_* environment variables, or launch pre-configured CLI sessions.

6 min read Updated July 2026

Configuration Precedence

Crawlingo session configuration follows a strict overlay hierarchy. Values loaded from higher layers override those below:

1
Default Engine Config
Built-in hardcoded Rust defaults.
2
File Config (TOML / JSON)
Parsed at initialization via crawlingo.toml or crawlingo.json.
3
Environment Variables
Process-wide CRAWLINGO_* overrides.
4
Runtime Setters
Explicit method calls (e.g. s.rate_limit(5)) take final precedence.

Configuration Specs

Field NameTypeDefaultDescription
headersMap<String, String>{}Default HTTP headers for all outgoing requests.
proxyStringNoneSingle proxy server URL (e.g., http://127.0.0.1:8080).
proxy_poolList<String>[]Round-robin proxy rotation pool list.
proxy_provider_urlStringNoneHTTP endpoint returning newline-separated proxy lists to dynamically reload.
rate_limit_rpsFloat0.0Requests-per-second limit per host (0.0 = unlimited).
auto_matchBooleanfalseEnable self-healing selector fingerprint repair (auto-matching).
timeout_secondsInteger30Request connection, handshake, and read timeout in seconds.
fingerprint_pathStringNonePath to storage directory for sled ACID self-healing fingerprints database.
fetcher_tierString"standard""standard" for raw high-speed HTTP/2; "stealthy" to activate TLS fingerprint rotation.
browser_profileString"chrome"Stealth client signature profile: "chrome", "firefox", or "safari".

Connection Pool Settings

Config FieldEnvironment VariableDefaultDescription
pool.max_idle_per_hostCRAWLINGO_POOL_MAX_IDLE_PER_HOST32Maximum idle connections retained per host.
pool.max_clientsCRAWLINGO_POOL_MAX_CLIENTS1024Hard limit on concurrent in-flight clients.
pool.idle_timeout_secsCRAWLINGO_POOL_IDLE_TIMEOUT_SECS90Duration in seconds after which idle connections are closed.

Retry Policy Settings

Config FieldEnvironment VariableDefaultDescription
retry.base_delay_msCRAWLINGO_RETRY_BASE_DELAY_MS100Initial delay in milliseconds for backoff.
retry.max_delay_msCRAWLINGO_RETRY_MAX_DELAY_MS10000Maximum cap on retry backoff delays.
retry.multiplierCRAWLINGO_RETRY_MULTIPLIER2.0Exponential backoff rate multiplier.

Example Config Files

crawlingo.toml
toml
proxy = "http://myproxy.com:8000"
rate_limit_rps = 3.5
auto_match = true
timeout_seconds = 45
fetcher_tier = "stealthy"
browser_profile = "firefox"

[pool]
max_idle_per_host = 16
idle_timeout_secs = 60

[retry]
base_delay_ms = 250
multiplier = 1.5
crawlingo.json
json
{
  "proxy": "http://myproxy.com:8000",
  "rate_limit_rps": 3.5,
  "auto_match": true,
  "timeout_seconds": 45,
  "fetcher_tier": "stealthy",
  "pool": {
    "max_idle_per_host": 16
  },
  "retry": {
    "base_delay_ms": 250
  }
}

CLI Interface

The Python SDK comes with a preconfigured command-line interface. Start standard scrapers, test query rules, or launch local agent server controllers instantly.

1. Quick Selector Extraction
bash
# Extract all H1 text content
crawlingo extract https://news.ycombinator.com --css "td.title a"

# Use XPath and output as a clean JSON map
crawlingo extract https://example.com --xpath "//h1" --json

# Run with self-healing auto-matching enabled
crawlingo extract https://shop.com --css "button.add-to-cart" --auto-match
2. Preloaded REPL Shell
bash
# Spin up Python REPL with Crawlingo Page/Session/Dataset classes pre-imported
crawlingo shell

# Fetch a page at load and place it inside the context as "page"
crawlingo shell https://example.com
3. Model Context Protocol Server
bash
# Start the local HTTP/SSE server for AI Agent integration
crawlingo mcp --host 127.0.0.1 --port 8000
💡

Pre-built Matched Binaries

If running inside server environments or containers, environment variables automatically take precedence over configurations loaded from TOML files, making it easy to configure proxies via K8s secrets.