Besides creating links one by one in the dashboard, ShrtFly offers free tools to shorten links automatically. This article explains each tool and how to set it up.
Most tools need your API key. You can find it in your Publisher Dashboard → Developer API. Keep it private: anyone with your key can create links on your account.
Use the API to shorten links from your own website, app or script. Send a GET request to:
https://shrtfly.com/api?api=YOUR_API_KEY&url=https://example.com/long-link&type=1&format=jsonParameter | Description |
|---|---|
api | Your API key (required) |
url | The long URL to shorten, URL-encoded (required) |
type | Link type: 1 = Mainstream, 2 = Adult |
format | json returns a JSON response; text returns only the short link as plain text |
If the key is wrong, the API returns an error, for example {"status":"error","result":"API key not valid. Please pass a valid API key."}
The Full Page Script converts the links on your website into ShrtFly links automatically when the page loads, so you don't have to change your posts. Copy the ready-made code from your dashboard (it already contains your API key), or use this template and paste it before the closing </body> tag:
<script type="text/javascript">
var app_url = 'https://shrtfly.com/';
var app_api_token = 'YOUR_API_KEY';
var app_advert = 1;
var app_domains = ['drive.google.com', 'mega.nz'];
</script>
<script src='https://shrtfly.com/js/full-page-script.js'></script>app_advert: 1 for mainstream websites, 2 for adult websites.
app_domains: only links to these domains are converted. Use *.example.com to include all subdomains.
Or use app_exclude_domains instead of app_domains: then all external links are converted except the domains in this list (for example your own domain and social media).
You must define either app_domains or app_exclude_domains, otherwise no links are converted. Magnet links are always converted.
Use the Mass Shrink tool in your dashboard to shorten many links at once: paste your list of URLs and copy all the short links together.
Shorten links directly in Telegram with our official bot @shrtflyofficial_bot. Open the bot, connect your ShrtFly account by following the bot's instructions, then send any URL to get a monetized short link back. You can also receive account updates through the bot.
Only use @shrtflyofficial_bot. Other bots using the ShrtFly name are not ours. Never send your password to any bot.
Shorten any page or link in one click while browsing.
Download the extension from the Chrome Extension section on the shrtfly.com homepage and unzip the file.
In Chrome, open chrome://extensions and turn on Developer mode (top-right).
Click Load unpacked and select the unzipped folder.
Click the ShrtFly icon in the toolbar, open Settings, paste your API key, choose the default ad type (Mainstream or Adult) and click Save Settings.
Now you can shorten the current page from the popup, or right-click any link and choose "Shorten link with ShrtFly" (or right-click a page and choose "Shorten this page with ShrtFly"). The extension also works in other Chromium browsers such as Edge, Brave and Opera.
The ShrtFly Auto Shortener plugin shortens links in your WordPress posts and pages automatically. It requires WordPress 5.8+ and PHP 7.4+.
Download the plugin from the WordPress Plugin section on the shrtfly.com homepage.
In WordPress, go to Plugins → Add New → Upload Plugin, upload the zip file and click Activate.
Go to Settings → SHRTFLY Auto Shortener.
Enter the API endpoint https://shrtfly.com/api and your API key.
Add Include rules (for example drive.google.com) so only these domains are shortened. If you leave Include rules empty, every external link is shortened except the ones in Exclude rules.
Save the settings and run the bulk processor once to shorten links in your old posts.
After that, links are shortened automatically whenever you publish or update a post. Internal links are skipped by default.
If you… | Use |
|---|---|
run a WordPress website | WordPress Plugin |
run any other website | Full Page Script |
share links in Telegram | Telegram Bot |
share links while browsing on desktop | Chrome Extension |
have a list of links to convert once | Mass Shrink |
are a developer or use your own app | Developer API |
To show adult ads on adult content, use the Adult link type (type 2). See How to create adult short link?