Shorten links from your own code, website or spreadsheet. Every link earns like a link made in your account.
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"}One address, one method: GET. Send the values in the address.
GET https://shrinkme.io/api
| Value | What it is | Needed |
|---|---|---|
api | Your API token. | Required |
url | The long link. If it has &, + or #, URL-encode it. | Required |
alias | Your own ending for the short link: letters, numbers, - and _, up to 30 characters. | Optional |
format | text returns only the short link, nothing else. | Optional |
The answer is JSON. Check status: it is success or error.
{
"status": "success",
"shortenedUrl": "https://shrinkme.click/AbC1"
}{
"status": "error",
"message": "Invalid API token",
"shortenedUrl": ""
}https://shrinkme.click/AbC1
With format=text the answer is empty on any error. Use JSON when you need to know why.
For alias and link problems, message is a list, for example ["Alias already exists."].
| Message | Why | What to do |
|---|---|---|
| Invalid API call | api or url is missing. | Send both. |
| Invalid API token | The 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 underscore | The 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. |
| Same long link again | You get the same short link, not a new one. |
A ShrinkMe.io short link as url | You get it back as it is. |
No http:// or https:// | We add http://. |
| Short link address | Always on shrinkme.click. |
| Limit | 50,000 new links a day per account. |
| Earnings | Same rates as any link you make. See Payout rates. |
| Your token | Keep it on your server. Anyone with it can make links in your account. |
curl "https://shrinkme.io/api?api=YOUR_API_TOKEN&url=https://example.com/page"
$token = 'YOUR_API_TOKEN';
$long = urlencode('https://example.com/page');
$json = file_get_contents("https://shrinkme.io/api?api=$token&url=$long");
$data = json_decode($json, true);
if ($data['status'] === 'success') {
echo $data['shortenedUrl'];
} else {
echo 'Error: ' . implode(' ', (array) $data['message']);
}// Node.js 18+. Run it on your server: never put your token in a web page.
const token = 'YOUR_API_TOKEN';
const long = encodeURIComponent('https://example.com/page');
const res = await fetch(`https://shrinkme.io/api?api=${token}&url=${long}`);
const data = await res.json();
console.log(data.status === 'success' ? data.shortenedUrl : data.message);import requests
r = requests.get("https://shrinkme.io/api", params={
"api": "YOUR_API_TOKEN",
"url": "https://example.com/page", # requests encodes it for you
})
data = r.json()
print(data["shortenedUrl"] if data["status"] == "success" else data["message"])=IMPORTDATA("https://shrinkme.io/api?api=YOUR_API_TOKEN&format=text&url="&ENCODEURL(A2))Put long links in column A, this formula in B2, and fill it down. An empty cell means that link had an error.
No code needed. All are in Member area › Tools.
| Tool | What it does | Use it when |
|---|---|---|
| Quick Link | An address you type before a long link. It opens your new short link. | You shorten one link at a time in the browser. |
| Mass Shrinker | Up to 20 long links at once, one per line. | You have a list of links. |
| Full Page Script | One script on your site turns its links into paying links. | You run a site with many download links. |
| Bookmarklet | A button in your bookmarks bar that shortens the page you are on. | You share pages as you browse. |
Shorten one link from your browser. No code.
https://shrinkme.io/st?api=YOUR_API_TOKEN&url=https://example.com/page
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.
One script on your site turns its links into paying links. Your page stays the same; only the link addresses change.
<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>| Your choice | In the code | Links that change |
|---|---|---|
| Only these domains | app_domains | Links to the listed domains. |
| Every domain except these | app_exclude_domains | All links except the listed domains. Add your own domain to the list. |
| Always | magnet: links. |