ShrtFly Tools: API, Full Page Script, Telegram Bot, Chrome Extension and WordPress Plugin

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.

1. Developer API

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=json

Parameter

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."}

2. Full Page Script

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>

You must define either app_domains or app_exclude_domains, otherwise no links are converted. Magnet links are always converted.

3. Mass Shrink

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.

4. Telegram Bot

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.

5. Chrome Extension

Shorten any page or link in one click while browsing.

  1. Download the extension from the Chrome Extension section on the shrtfly.com homepage and unzip the file.

  2. In Chrome, open chrome://extensions and turn on Developer mode (top-right).

  3. Click Load unpacked and select the unzipped folder.

  4. 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.

6. WordPress Plugin

The ShrtFly Auto Shortener plugin shortens links in your WordPress posts and pages automatically. It requires WordPress 5.8+ and PHP 7.4+.

  1. Download the plugin from the WordPress Plugin section on the shrtfly.com homepage.

  2. In WordPress, go to Plugins → Add New → Upload Plugin, upload the zip file and click Activate.

  3. Go to Settings → SHRTFLY Auto Shortener.

  4. Enter the API endpoint https://shrtfly.com/api and your API key.

  5. 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.

  6. 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.

Which tool should I use?

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?