
YOURLS n8n INTEGRATION: AUTOMATE YOURLS WITH N8N
Looking to automate your URL shortening operations with Yourls and n8n? You're in the right place. The Yourls n8n integration gives you access to 3 powerful actions to manage your short URLs directly from your automation workflows.
Yourls (Your Own URL Shortener) is a self-hosted URL shortening service that gives you complete control over your link management. By connecting it to n8n, you can automatically shorten URLs, retrieve click statistics, and expand short links back to their original form—all without manual intervention.
Whether you're tracking marketing campaigns, generating shareable links on the fly, or analyzing link performance across your workflows, this integration lets you build sophisticated automations that handle URL operations seamlessly. Let's dive into how you can fully leverage the Yourls n8n integration for your projects.
Need help automating Yourls with n8n?
Our team will get back to you in minutes.
Why automate Yourls with n8n?
The Yourls n8n integration gives you access to 3 essential actions for comprehensive URL management: shorten URLs, expand short links, and retrieve detailed statistics. This means you can build end-to-end automations that handle every aspect of your link operations without switching between tools or performing repetitive manual tasks.
Significant time savings stand out as the primary benefit. Instead of manually logging into your Yourls dashboard to create short links, you can automatically generate them whenever a new blog post is published, a product is added to your catalog, or a campaign is launched. Set up your workflow once, and let n8n handle the rest 24/7.
Enhanced tracking and analytics become effortless when you automate statistics retrieval. Imagine automatically pulling click data for all your campaign links every morning and sending a summary to Slack, or triggering alerts when a specific link reaches a performance threshold. The Expand URL action also proves invaluable for auditing—automatically verify where your short links actually point, ensuring no broken or hijacked URLs slip through.
Concrete use cases include: automatically shortening URLs from your CMS before social media posting, building link performance dashboards that update in real-time, validating bulk link lists by expanding and checking destinations, and integrating URL shortening into your lead generation workflows where every form submission generates a trackable link.
How to connect Yourls to n8n?
! 1 stepHow to connect Yourls to n8n?
- 01
Add the node
The Yourls n8n integration uses API authentication to securely connect your self-hosted Yourls instance to n8n. Since Yourls is self-hosted, you'll need your server URL and API signature token to establish the connection.Basic configuration:Access your Yourls admin panel: Log into your Yourls installation and navigate to the Tools or Admin section where you can find your API signature token.Locate your API signature: In Yourls, the signature token is typically found in the Tools page. This token authenticates API requests without exposing your password.Add credentials in n8n: In your n8n workflow, click on any Yourls node, then select "Create New" under the credential dropdown. Enter your Yourls server URL (e.g., https://your-domain.com/yourls) and paste your API signature token.Test the connection: Save your credentials and run a simple test action like "Shorten URL" to verify everything works correctly.
TIP💡 TIP: Keep your Yourls API signature secure and rotate it periodically. If you suspect it's been compromised, regenerate it immediately from your Yourls admin panel. Also, ensure your Yourls installation uses HTTPS to encrypt API communications—this prevents your signature from being intercepted during transit. For more complex n8n setups, check our n8n troubleshooting guide.- 01
Need help automating Yourls with n8n?
Our team will get back to you in minutes.
Yourls actions available in n8n
01 Action 01Shorten URL
The Shorten URL action is the core functionality of the Yourls n8n integration, allowing you to programmatically generate short links from any long URL within your workflows. This action takes a standard URL and returns a compact, trackable link hosted on your Yourls server.
Key parameters for this action:
- Credential to connect with: A required dropdown field where you select your configured Yourls account credentials. This authenticates your request against your Yourls server.
- Resource: A required dropdown set to "URL", indicating you're working with URL objects.
- Operation: A required dropdown configured to "Shorten" to generate shortened links.
- URL: A required text input field where you enter the long URL to be shortened. This field accepts both fixed values (manually typed URLs) and expressions (dynamic URLs from previous workflow nodes).
- Additional Fields: An optional section where you can add parameters like custom keywords (to create memorable short URLs like yourls.com/summer-sale), titles for better organization in your Yourls dashboard, or other customization options.
When to use this action: Perfect for social media automation (shortening blog links before posting), email campaign preparation (generating trackable links for newsletters), or any workflow where you need clean, manageable URLs. Combine it with the URL Stats action to create complete link management automations. You can also integrate with Bitly for additional URL shortening options.

02 Action 02Expand URL
The Expand URL action reverses the shortening process, revealing the original destination URL behind any short link created in your Yourls instance. This is essential for auditing, verification, and data integrity workflows.
Key parameters for this action:
- Credential to connect with: A required dropdown to select your Yourls account credentials for authentication.
- Resource: A required dropdown set to "URL" to specify you're working with URL resources.
- Operation: A required dropdown set to "Expand" to retrieve the original long URL.
- Short URL: A required text input field where you provide the abbreviated URL to be expanded. Supports both fixed values and expressions for dynamic input from previous nodes.
Typical use cases include:
- Link auditing: Automatically verify that all short links in a spreadsheet or database point to the correct destinations
- Security checks: Validate that short URLs haven't been modified or hijacked before including them in communications
- Data migration: When moving link data between systems, expand all short URLs to preserve the original references
- Debugging workflows: Quickly check what destination a particular short link resolves to during workflow development
This action is particularly valuable for teams managing large numbers of short links who need to periodically audit their link inventory for accuracy and security.

03 Action 03URL Stats
The URL Stats action retrieves performance metrics for any short URL in your Yourls database, providing click counts and other statistical data essential for measuring link engagement and campaign effectiveness.
Key parameters for this action:
- Credential to connect with: A required dropdown field for selecting your Yourls account credentials to authenticate the statistics request.
- Resource: A required dropdown set to "URL", defining that you're querying URL-related data.
- Operation: A required dropdown configured to "Stats" to fetch statistical information rather than performing other URL operations.
- Short URL: A required text input field where you specify the short URL for which you want to retrieve statistics. This parameter accepts fixed values or expressions for dynamic stat retrieval.
Powerful use cases for URL Stats:
- Automated reporting: Pull stats for all campaign links daily and compile them into a Google Sheet or send a summary via email
- Performance alerts: Trigger notifications when a link exceeds a certain click threshold, indicating viral content or successful campaigns
- A/B testing analysis: Compare click performance between different short URLs to determine which messaging or channels perform best
- Dashboard building: Feed link statistics into visualization tools or databases to create real-time performance dashboards
Pro tip: Combine URL Stats with n8n's scheduling capabilities to build automated daily or weekly link performance reports. You can loop through multiple short URLs, aggregate their statistics, and output comprehensive reports without any manual data gathering.

Build your first workflow with our team
Drop your email and we'll send you the catalog of automations you can ship today.
- Free n8n & Make scenarios to import
- Step-by-step setup docs
- Live cohort + community support
Frequently asked questions
Is the Yourls n8n integration free to use?
Yes, the Yourls n8n integration is completely free as both components are open-source. Yourls itself is a free, self-hosted URL shortener that you install on your own server, and n8n offers a free self-hosted version as well as a cloud option with a free tier. The only costs you might incur are hosting fees for your Yourls installation and potentially n8n Cloud subscription if you exceed the free tier limits. Since Yourls runs on your own infrastructure, you maintain full control over your data and link management without any per-link fees or usage restrictions.What data can I retrieve from Yourls through n8n?
Through the Yourls n8n integration, you can work with URL-related data in three main ways. The Shorten action returns your newly created short URL along with its metadata. The Expand action retrieves the original long URL from any short link. The Stats action provides click count data and performance metrics for your short URLs. While the specific data fields depend on your Yourls installation and plugins, standard returns include the short URL, long URL, creation timestamp, click counts, and title information. You can use this data to build comprehensive link management and analytics workflows, or store it in databases like Airtable for further analysis.Can I create custom short URLs with specific keywords using n8n?
Yes, the Shorten URL action includes an "Additional Fields" section where you can specify custom keywords for your short URLs. Instead of letting Yourls generate a random string, you can define memorable slugs like "summer-sale" or "webinar-2024" that create branded, recognizable links (e.g., yourls.com/summer-sale). This feature is particularly useful for marketing campaigns, social media posts, or any situation where link readability matters. Simply add the keyword field in the Additional Fields section and enter your desired custom slug before executing the action. For more automation ideas, explore our downloadable automation catalog.



