> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# url_extract_host

> Extracts the host section from a URL.

Extracts the host section from a URL.

This function is supported from v3.3 onwards.

## Syntax

```haskell theme={null}
VARCHAR url_extract_host(VARCHAR str)
```

## Parameters

* `str`: the string to extract its host string. If `str` is not a string, this function will try implicit cast first.

## Return value

Returns the host string.

## Examples

```plaintext theme={null}
mysql> select url_extract_host('httpa://starrocks.com/test/api/v1');
+-------------------------------------------------------+
| url_extract_host('httpa://starrocks.com/test/api/v1') |
+-------------------------------------------------------+
| starrocks.com                                         |
+-------------------------------------------------------+
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.