Reference · Tools
YOURLS
Shorten, expand, and get stats for URLs using a self-hosted YOURLS instance
The YOURLS node shortens URLs, expands short links back to their targets, and retrieves click statistics from a self-hosted YOURLS instance. A typical build is shortening every campaign link automatically and reporting the click counts back into a dashboard.
- Node type
- Action
- Parameters
- 7
- Outputs
- Output, Error
- Credentials
- YOURLS API
YOURLS
Shorten, expand, and get stats for URLs via YOURLS
Overview
YOURLS (Your Own URL Shortener) is a self-hosted PHP-based URL shortening service. This tool interacts with the YOURLS API to shorten long URLs into short links, expand short URLs back to their original form, and retrieve click statistics for shortened URLs. YOURLS must be self-hosted and the API must be enabled with a signature token for authentication.
Category: Utility
Tool Name: yourls
Version: 1
Appearance: Icon: lucide-Link | Color: #396DB1
Node Type
Action — processes input items and produces output
Input / Output
| Direction | Port(s) |
|---|---|
| Input | Input |
| Output | Output, Error |
Credentials
This tool requires YOURLS API credentials. See the Credentials Guide for setup instructions.
Resources
| Resource | Value |
|---|---|
| URL | url |
Operations
| Operation | Value | Description |
|---|---|---|
| Expand | expand | Expand a short URL to its original long URL |
| Shorten | shorten | Shorten a long URL |
| Stats | stats | Get click statistics for a short URL |
Parameters
URL: Shorten
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| URL | string | Yes | — | The long URL to shorten. Supports expressions like {{ $json.longUrl }}. |
| Additional Fields | collection | No | {} | Optional extra values sent with the shorten request. |
| — Keyword | string | No | — | Custom keyword (slug) for the short URL. If not specified, YOURLS will generate one automatically. |
| — Title | string | No | — | Title for the custom short URL. Used for display/organizational purposes. |
URL: Expand
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Short URL | string | Yes | — | The short URL or keyword to expand back to the original long URL. Supports expressions. |
URL: Stats
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Short URL | string | Yes | — | The short URL or keyword to get click statistics for. Supports expressions. |
All Operations
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Max Concurrency | number | No | 10 | Maximum number of items to process concurrently. |
Output Data
One output item per input item — no operation fans out. The fields of the YOURLS API response are merged onto the top level of the item JSON; anything already on the item passes through, and binary data is forwarded unchanged.
| Operation | What lands on the item |
|---|---|
shorten | The shorturl response from YOURLS, including the generated short link, its keyword and the original URL |
expand | The expand response, including the long URL the keyword points at |
stats | The link object from the response is unwrapped first, so its click-count fields land directly on the item rather than nested under link |
Reference the result downstream by expression, for example {{ $json.shorturl }}.
Usage Examples
- Shorten a long URL with YOURLS
- Expand a YOURLS short link to its original URL
- Get click stats for a YOURLS short URL
- Create a custom keyword short URL with YOURLS
Example Configuration
Shorten a URL:
{
"type": "yourls",
"parameters": {
"resource": "url",
"operation": "shorten",
"url": "https://www.example.com/very/long/path/to/some/resource"
}
}
Shorten a URL with a custom keyword and title:
{
"type": "yourls",
"parameters": {
"resource": "url",
"operation": "shorten",
"url": "https://www.example.com/very/long/path/to/some/resource",
"additionalFields": {
"keyword": "example-page",
"title": "Example Resource Page"
}
}
}
Expand a short URL:
{
"type": "yourls",
"parameters": {
"resource": "url",
"operation": "expand",
"shortUrl": "abc123"
}
}
Get statistics for a short URL:
{
"type": "yourls",
"parameters": {
"resource": "url",
"operation": "stats",
"shortUrl": "abc123"
}
}
Shorten one URL per incoming item, taking the link and the title from the item:
{
"type": "yourls",
"parameters": {
"resource": "url",
"operation": "shorten",
"url": "{{ $json.longUrl }}",
"maxConcurrency": 15,
"additionalFields": {
"title": "{{ $json.pageTitle }}"
}
}
}
Error Handling
| Mode | Behavior |
|---|---|
| stop | Halts workflow on first error |
| continue | Skips failed items, passes successful ones through |
| errorPort | Routes failed items to Error output port |
Tips
Shorten URLs, expand short URLs, and get click stats using a self-hosted YOURLS URL shortener.
Parameter Relationships
The YOURLS tool uses a conditional parameter system where the available parameters depend on the selected operation:
- Base requirement:
resourcemust be"url"(only option available) - Operation selection:
operationdetermines which additional parameters are available - Operation-specific parameters:
"shorten"→ requiresurl, optionally usesadditionalFields"expand"→ requiresshortUrl"stats"→ requiresshortUrl
This hierarchical relationship ensures that only relevant parameters are presented based on the chosen operation type.
Frequently asked questions
Which operations are available?
Shorten, expand and stats, on the single `url` resource. The operation you choose determines which additional parameters appear.
Why self-host a shortener?
Branded short links and full ownership of the click data, which is the main reason teams run YOURLS rather than using a hosted service.
Can it report on link performance?
Yes — the stats operation returns click statistics, so campaign reporting can be automated.
Which credential does it need?
A YOURLS API credential pointing at your instance.
Build with the YOURLS node
Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need YOURLS API credentials first.
Open BusyBotLast updated . Spotted something wrong? Tell us.