ShrinkMe API

Shorten links from your own code, website or spreadsheet. Every link earns like a link made in your account.

Quick start

1Sign upA free account is enough.
2Copy your API tokenMember area › Tools › Developer API.
3Open this addressIn your browser, with your token.
https://shrinkme.io/api?api=YOUR_API_TOKEN&url=https://example.com/page

You get your short link back:

{"status":"success","shortenedUrl":"https://shrinkme.click/AbC1"}

The request

One address, one method: GET. Send the values in the address.

GET https://shrinkme.io/api
ValueWhat it isNeeded
apiYour API token.Required
urlThe long link. If it has &, + or #, URL-encode it.Required
aliasYour own ending for the short link: letters, numbers, - and _, up to 30 characters.Optional
formattext returns only the short link, nothing else.Optional

Answers

The answer is JSON. Check status: it is success or error.

Success
{
  "status": "success",
  "shortenedUrl": "https://shrinkme.click/AbC1"
}
Error
{
  "status": "error",
  "message": "Invalid API token",
  "shortenedUrl": ""
}
With format=text
https://shrinkme.click/AbC1

With format=text the answer is empty on any error. Use JSON when you need to know why.

Errors

For alias and link problems, message is a list, for example ["Alias already exists."].

MessageWhyWhat to do
Invalid API callapi or url is missing.Send both.
Invalid API tokenThe token is wrong, or the account is not active.Copy it again from Member area › Tools › Developer API.
Alias already exists.That ending is taken.Pick another, or leave alias out.
Alias can only contain letters, numbers, dash and underscoreThe alias has other characters.Use a–z, A–Z, 0–9, - and _.
Maximum alias length is 30 characters.The alias is too long.Use 30 characters or fewer.
This alias is a reserved word.The site uses that word.Pick another.
Your account has exceeded its daily created short links limit.50,000 new links today.Try again tomorrow.
URL is invalid.The long link is not a link.Send a full address, starting with https://.
This domain is not allowed on our system.The site is blocked, or it is a ShrinkMe.io short link that does not exist.Check the link. See the Terms of use for what is allowed.

How it works

Same long link againYou get the same short link, not a new one.
A ShrinkMe.io short link as urlYou get it back as it is.
No http:// or https://We add http://.
Short link addressAlways on shrinkme.click.
Limit50,000 new links a day per account.
EarningsSame rates as any link you make. See Payout rates.
Your tokenKeep it on your server. Anyone with it can make links in your account.

Good to know

  • Errors still answer with HTTP 200. Check status, not the HTTP code.
  • Links with &, + or # must be URL-encoded. Otherwise they are cut or changed: ?a=1&b=2 is saved as ?a=1. The PHP, JavaScript, Python and Sheets examples encode for you.
  • Save your short links. The same long link always gives the same short link, so there is no need to ask again.
  • Slashes come escaped in JSON (https:\/\/…). Any JSON reader turns them back.
  • Google Sheets limits how often IMPORTDATA runs, so very large sheets fill in slowly.

Examples

curl "https://shrinkme.io/api?api=YOUR_API_TOKEN&url=https://example.com/page"

Other tools

No code needed. All are in Member area › Tools.

ToolWhat it doesUse it when
Quick LinkAn address you type before a long link. It opens your new short link.You shorten one link at a time in the browser.
Mass ShrinkerUp to 20 long links at once, one per line.You have a list of links.
Full Page ScriptOne script on your site turns its links into paying links.You run a site with many download links.
BookmarkletA button in your bookmarks bar that shortens the page you are on.You share pages as you browse.

Quick Link

Shorten one link from your browser. No code.

https://shrinkme.io/st?api=YOUR_API_TOKEN&url=https://example.com/page
1Copy your Quick LinkMember area › Tools › Quick Link. Your token is already in it.
2Put your long link at the endAfter &url=, as it is. No encoding needed.
3Press EnterYour short link opens, ready to copy.

Make it a shortcut

In Chrome: Settings › Search engine › Site search › Add. Shortcut sm, address:

https://shrinkme.io/st?api=YOUR_API_TOKEN&url=%s

Then type sm, a space and any link in the address bar.

Full Page Script

One script on your site turns its links into paying links. Your page stays the same; only the link addresses change.

1Make your codeMember area › Tools › Full Page Script. Choose the domains, press Generate code.
2Paste it before </body>On every page. In WordPress: a footer-code plugin or your theme's footer.
3Check a linkHover over a matching link: it now starts with shrinkme.io/full.
<script type="text/javascript">
    var app_url = 'https://shrinkme.io/';
    var app_api_token = 'YOUR_API_TOKEN';
    var app_advert = 2;
    var app_domains = ["mega.nz", "*.mediafire.com"];
</script>
<script src='//shrinkme.io/js/full-page-script.js'></script>

Which links change

Your choiceIn the codeLinks that change
Only these domainsapp_domainsLinks to the listed domains.
Every domain except theseapp_exclude_domainsAll links except the listed domains. Add your own domain to the list.
Alwaysmagnet: links.

Links did not change?

  • Domains match exactly. mediafire.com does not cover www.mediafire.com. Use *.mediafire.com: it covers both.
  • The code must be on the page. Paste it before </body>, and clear your site's cache.
  • Links added later are not changed. The script runs once, when the page loads.
  • Check the token. Copy the code again from Member area › Tools.

Questions

Is the API free?Yes, for every account.
Do links made with the API earn money?Yes, at the same rates as other links.
Can I list, edit or delete links with the API?No. The API only shortens. Manage your links in Member area › Links.
My token leaked. What now?Write to Support from the member area. We will give you a new token.
Where do I find my token?Member area › Tools › Developer API.