Search Shortcut cmd + k | ctrl + k

A DuckDB extension for URL analytics on messy event logs.

Maintainer(s): Flamefork

Compatibility Matrix

This table covers all DuckDB releases that have not reached end-of-life, including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.

Platform 1.5.5 1.5.6 2.0.0 2.0.1
Linux AMD64
Linux ARM64
macOS AMD64
macOS ARM64
Windows AMD64
Windows ARM64
WebAssembly

Installing and Loading

INSTALL url_tools FROM community;
LOAD url_tools;

Example

INSTALL url_tools FROM community;
LOAD url_tools;

SELECT url_components('https://example.com:8443/path?utm_source=duckdb&id=1&id=2#top');
-- {'scheme': https, 'host': example.com, 'port': 8443, 'path': /path, 'query': 'utm_source=duckdb&id=1&id=2', 'fragment': top}

-- Attribution: UTM tags in any key case, also from a single-page-app fragment
SELECT query_params('https://shop.com/#/cart?UTM_Source=push&utm_medium=app', 'last', input := 'loose', query_keys := 'lower_case');
-- {utm_source=push, utm_medium=app}

-- Grouping by site: subdomains are one site
SELECT url_domain('https://m.ozon.ru/p/1'), url_domain('https://shop.example.co.uk/');
-- ozon.ru, example.co.uk

About url_tools

url_tools does URL analytics on messy event logs. In event and marketing analytics, a URL and its query parameters are dimensions: you attribute events by UTM tags, click ids, deeplinks, the referrer and the landing page, and you group them by site and page.

The extension parses with ada, the WHATWG-compliant URL parser. Each function is total over its input: a junk value gives NULL or an empty map, never an error, so one bad value cannot fail a full scan.

Functions

  • Parse a URL: url_components (the WHATWG components as a STRUCT, the query raw or parsed into a MAP), url_scheme, url_host, url_port, url_path, url_query, url_fragment, and url_domain (the registrable domain from a compiled-in Public Suffix List).
  • Transform a URL: url_normalize (the canonical WHATWG form, or a reference resolved against a base URL), url_origin.
  • Extract query parameters: query_params (a MAP from a URL, a query string or a loose marketing string) and query_param (the value of one key), with the case variants of a key optionally read as one key.
  • The decode option returns URL text as WHATWG serializes it, as a readable IRI, or fully decoded.

Stability. The SQL API can change while the version is 0.x.

Maintenance is best-effort, by one maintainer. Give feedback and contributions through GitHub.

Full documentation: https://github.com/Flamefork/duckdb-url-tools#readme

Added Functions

function_name function_type description comment examples
query_param scalar NULL NULL  
query_params scalar NULL NULL  
url_components scalar NULL NULL  
url_domain scalar NULL NULL  
url_fragment scalar NULL NULL  
url_host scalar NULL NULL  
url_normalize scalar NULL NULL  
url_origin scalar NULL NULL  
url_path scalar NULL NULL  
url_port scalar NULL NULL  
url_query scalar NULL NULL  
url_scheme scalar NULL NULL  

Overloaded Functions

This extension does not add any function overloads.

Added Types

type_name type_size logical_type type_category internal
VARCHAR 16 VARCHAR STRING true

Added Settings

name description input_type scope aliases typed_value
temp_directory Set the directory to which temporary files are written. VARCHAR GLOBAL [] post.db.tmp
© 2026 DuckDB Foundation, Amsterdam NL
DuckDB Home Code of Conduct Trademark Use Blog