Xberg

crawlberg

Built with alef Rust Python Node.js WASM Java Go C# PHP Ruby Elixir Dart Kotlin Swift Zig C FFI Docker License Documentation
Join Discord

Elixir bindings for crawlberg — a high-performance Rust web crawling engine. Uses Rustler NIFs for native BEAM integration with OTP-compatible error tuples and ResourceArc handles.

What This Package Provides

Installation

def deps do
  [{:crawlberg, "~> 1.12.0"}]
end

Agent plugin

The crawlberg plugin is available via the xberg-io/crawlberg marketplace.

/plugin marketplace add xberg-io/crawlberg
/plugin install crawlberg@crawlberg

See the plugin guide for all supported runtimes, CLI prerequisites and standalone public skills.

Quick Start

# Simplest case: scrape a single page with default settings.
{:ok, engine} = Crawlberg.create_engine()
{:ok, scrape} = Crawlberg.scrape(engine, "https://example.com/")
IO.puts("Title: #{scrape.metadata.title}")
IO.puts("Status: #{scrape.status_code}")
IO.puts("Links found: #{length(scrape.links)}")

# Crawl from a seed URL, limited to one hop and a handful of pages.
config_json = Jason.encode!(%Crawlberg.CrawlConfig{max_depth: 1, max_pages: 5})
{:ok, crawl_engine} = Crawlberg.create_engine(config_json)
{:ok, crawl} = Crawlberg.crawl(crawl_engine, "https://en.wikipedia.org/wiki/Web_scraping")
IO.puts("Pages crawled: #{length(crawl.pages)}")

API Reference

Full API documentation is available at docs.crawlberg.xberg.io.

Key functions:

Contributing

Contributions are welcome! Please see our Contributing Guide for details.

Part of Xberg.io

License

This project is licensed under MIT License.