# Parse URL

> Parse a URL into parts.

- ID: `parse_url`
- Type: Block
- Category: [Strings](https://inventor.bot/docs/reference/blocks/strings.md)

**Inputs**

| Name | Required | Description | Value |
| --- | --- | --- | --- |
| `url` | yes | URL | e.g. `"https://www.example.com:8080/docs/page?lang=en#intro"` |

**Outputs**

| Name | Description | Value |
| --- | --- | --- |
| `protocol` | Protocol, such as https or file. | e.g. `"https"` |
| `host` | Host name, without the port. | e.g. `"www.example.com"` |
| `domain` | Registered domain, without subdomains. | e.g. `"example.com"` |
| `port` | Port, if the URL has one. | e.g. `"8080"` |
| `path` | Path after the host. | e.g. `"/docs/page"` |
| `query` | Query string, without the ?. | e.g. `"lang=en"` |
| `fragment` | Text after the #. | e.g. `"intro"` |

**Example**

```go
parseUrl := parse_url(Args{url: "https://www.example.com:8080/docs/page?lang=en#intro"})
send_text_message(Args{
	channel_id:      trigger.channel_id,
	message_content: "Protocol: " + parseUrl.protocol,
})
```