ferret is a free, open source data extraction & web scraping project written in Go and released under Apache-2.0. It has 6,011 GitHub stars, 324 forks and 12 open issues, and was last pushed 26 hours ago. On this registry it ranks #30 of 45 tracked projects in Data Extraction & Web Scraping, with 5 head-to-head comparisons available.

What is ferret?

Ferret is a declarative data automation language and embeddable Go runtime for structured extraction workflows, built for Go developers who need to query, transform, and synchronize structured data across browsers, APIs, databases, and documents from inside their own applications.

What it is

Ferret is a declarative-first, expression-oriented embedded language called FQL, paired with a runtime written in Go. FQL combines querying, transformation, synchronization, and structured results with host-defined values and capabilities, so an application can embed the runtime and decide exactly which functions, modules, data, and external operations a program is allowed to use. The language keeps a declarative core and adds domain-oriented orchestration plus constrained mutable state for automation that cannot be expressed as a pure data transformation. It is deliberately focused rather than a general-purpose scripting language. The project lives in the Go ecosystem as an importable module under github.com/MontFerret/ferret/v2, is licensed Apache-2.0, and is categorised under Data & Analytics / Data Extraction & Web Scraping. The branch described here carries the upcoming Ferret v2, currently in alpha; the stable v1 release lives on the v1 branch.

The concrete problem it solves is the pile of imperative glue that Go services accumulate when they need to pull structured data out of heterogeneous sources. Ferret replaces a general-purpose embedded scripting language plus hand-written orchestration with one unified query model covering browsers, APIs, databases, documents, and custom data sources. Capability-based host values let the embedding application expose its own objects, resources, and external systems to FQL directly, while managed resource lifecycle handles files, connections, cursors, and streams. The result is that extraction logic becomes a declarative program the host compiles once and runs many times, rather than a scatter of ad-hoc calls.

Key capabilities

  • Declarative FQL language for querying, transforming, synchronizing, and automating structured data, with a constrained mutable state model for automation that is not a pure transformation.
  • Embeddable Go runtime used through ferret.New(opts...), with a flow of compile query, create session, then run: eng.Compile(ctx, ferret.NewAnonymousSource(...)), plan.NewSession(ctx), session.Run(ctx).
  • Reusable compiled plans and isolated execution sessions, so a program can be compiled once and executed repeatedly.
  • Capability-based host values that expose application objects, resources, and external systems to FQL, with the host deciding which functions, modules, and operations a program may reach.
  • Unified query model spanning browsers, APIs, databases, documents, and custom data sources, reflected in topics such as chrome-devtools-protocol, browser-automation, html, and data-extraction.
  • Extensible runtime through namespaced functions, modules, hooks, and custom value types.
  • Event-driven synchronization and dispatch for asynchronous and stateful resources, plus a bytecode VM and portable programs supporting precompiled artifacts.

Who uses it and how

  • Go teams embedding an automation or extraction engine inside an existing service, where the host must control which host values and external operations each program can use.
  • Existing Ferret v1 integrations migrating in two stages: first to the v2 compatibility API via the compat module, then incrementally to the native v2 API.
  • Applications built on github.com/MontFerret/api, which use the official adapter package github.com/MontFerret/ferret/v2/uapi; uapi.New(opts...) creates and owns a native engine, while uapi.Wrap(native) borrows an existing one and its Close is a no-op.
  • Workloads that benefit from precompiled artifacts and repeated execution through the bytecode VM rather than recompiling queries per run.
  • Browser and HTML extraction workflows, given the project's browser-automation and Chrome DevTools Protocol topics.

Getting started

Install the module with go get github.com/MontFerret/ferret/v2@latest. New projects should use the native v2 API, while existing v1 integrations should start with the compat module, and the language can be tried in the browser playground linked from the README.

How it compares

No list of paid or proprietary products that Ferret replaces is provided in the available facts. Among similar tools, no directly comparable project is named either, so on the evidence here Ferret stands alone in this registry.

When to use it — and when not to

Ferret v2 is in alpha, so teams needing a stable target should stay on the v1 branch or plan a two-stage migration through the compat module before adopting the native API. Embedding it means operating a Go dependency and respecting a lifecycle contract: sessions and plans must be settled and closed before their owning runtime or borrowed engine. It is a poor fit for anyone wanting a general-purpose scripting language or a non-Go host, since it is intentionally narrow and its runtime is a Go library.

project readme (upstream, from github) — read inline

Ferret

Build Status Mastodon Follow Telegram Group Ferret release Apache-2.0 License

Try it! Docs CLI Test runner Web worker


Explore Ferret v2

Ferret v2 is currently in alpha. You can try the new syntax in the playground and read more about the design behind the new runtime and language capabilities:


Notice: This branch contains the upcoming Ferret v2. For the stable v1 release, please visit Ferret v1.


What is it?

Ferret is a declarative-first, expression-oriented embedded language and runtime for data automation.

FQL combines querying, transformation, synchronization, and structured results with host-defined values and capabilities. Applications can embed the runtime and decide exactly which functions, modules, data, and external operations a program can use.

The language keeps a declarative core and adds domain-oriented orchestration plus constrained mutable state for automation that cannot be expressed as a pure data transformation. It is deliberately focused rather than a general-purpose scripting language.

Features

  • Purpose-built declarative language for querying, transforming, synchronizing, and automating structured data
  • Embeddable Go runtime with reusable compiled plans and isolated execution sessions
  • Capability-based host values for exposing application objects, resources, and external systems directly to FQL
  • Unified query model for browsers, APIs, databases, documents, and custom data sources
  • Extensible runtime through namespaced functions, modules, hooks, and custom value types
  • Event-driven synchronization and dispatch for interacting with asynchronous and stateful resources
  • Managed resource lifecycle for files, connections, cursors, streams, and other host resources
  • Bytecode VM and portable programs for efficient repeated execution and precompiled artifacts

Getting started

go get github.com/MontFerret/ferret/v2@latest

There are currently two ways to start with Ferret v2:

  • Native v2 API - recommended for new projects
  • compat module - recommended as a first migration step for existing v1 integrations

Use github.com/MontFerret/ferret/v2 and ferret.New(opts...) for Native embedding. For integrations using github.com/MontFerret/api, the official adapter is the separate github.com/MontFerret/ferret/v2/uapi package. uapi.New(opts...) creates and owns a Native engine; runtime Close closes it. uapi.Wrap(native) borrows an existing engine; its Close is a no-op that leaves both usable. Settle work and close sessions and plans before their owning runtime or borrowed engine. See the Universal adapter guide for the supported options and lifecycle contract.

New projects

Use the native v2 API built around the following flow:

Engine -> compile query -> create session -> run
package main

import (
	"context"
	"fmt"
	"log"

	"github.com/MontFerret/ferret/v2"
)

func main() {
	ctx := context.Background()

	eng, err := ferret.New()
	if err != nil {
		log.Fatal(err)
	}
	defer eng.Close()

	plan, err := eng.Compile(ctx, ferret.NewAnonymousSource(`return 1 + 1`))
	if err != nil {
		log.Fatal(err)
	}
	defer plan.Close()

	session, err := plan.NewSession(ctx)
	if err != nil {
		log.Fatal(err)
	}
	defer session.Close()

	output, err := session.Run(ctx)
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(string(output.Content))
}

Migration from v1

Ferret v2 introduces a new architecture and public API, so existing Go applications should migrate in two stages: first to the v2 compatibility API, then incrementally to the native v2 API.

Run the ferret migrate command from anywhere inside the application's Go module:

ferret migrate --dry-run # List the files that would change
ferret migrate --print   # Print a unified diff without changing files
ferret migrate           # Apply the migration

The command rewrites the documented v1 imports to their v2 compatibility packages, updates go.mod and go.sum as required by those rewrites, and formats changed Go files. Generated, vendored, and nested-module files are left untouched. Unsupported v1 imports are reported as manual follow-up; if the project vendors dependencies, run go mod vendor after applying the migration.

This is only the mechanical compatibility stage. The command does not convert application logic to the native v2 API or migrate drivers and other unsupported v1 packages. Running it again on an already-migrated compatibility project is a no-op and does not upgrade the Ferret v2 dependency merely because the CLI is newer.

After applying the migration, address any reported manual follow-up, build and test the application, and then migrate to the native v2 API over time. The compatibility layer is a migration aid, not the long-term preferred API; new projects should use the native v2 packages directly.

Alpha status

Ferret v2 is currently in active development.

Alpha releases are intended for early adopters, experimentation, and feedback. Some APIs and language features may still change before the stable v2 release.

Maintainers

Support Ferret

Ferret is supported by organizations and community members who help fund its continued development. View all supporters.

Frequently asked questions

Is ferret free to use?

ferret is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does ferret do?

Declarative data automation language and Go runtime for structured extraction workflows.

What is ferret written in?

ferret is primarily written in Go. Its source is publicly available at https://github.com/MontFerret/ferret, and it has 6,011 GitHub stars.