API
Shorten links from your own scripts, apps or plugins. Get your key from the dashboard. The request and response formats are the same ones most shortener plugins already use, so tools built for other paid shorteners usually work by changing only the domain and key.
Shorten a link
GET https://shrinkbux.com/api?api=YOUR_KEY&url=https://example.com/page
Response:
{"status":"success","shortenedUrl":"https://shrinkbux.com/AbC123"}
On failure:
{"status":"error","message":"invalid API key"}
Options
- alias — choose the code yourself: &alias=mylink (4 to 16 letters, digits, - or _; must be free)
- format=text — respond with just the short URL as plain text, handy for shell scripts and bookmarklets
- The key can also be sent as a header: Authorization: Bearer YOUR_KEY
- POST https://shrinkbux.com/api/v1/links with the same fields works too
Good to know
- Shortening the same destination twice returns the same short link (unless you set an alias)
- Limit: 60 requests per minute per key, and the usual daily link limit
- The Content Policy applies to links made through the API
- Keep the key secret. Make a new one from the dashboard if it leaks; the old key stops working at once
Examples
# curl
curl "https://shrinkbux.com/api?api=YOUR_KEY&url=https://example.com/page"
# PHP
$r = json_decode(file_get_contents("https://shrinkbux.com/api?api=YOUR_KEY&url=" . urlencode($long)));
echo $r->shortenedUrl;
# Python
import requests
r = requests.get("https://shrinkbux.com/api", params={"api": "YOUR_KEY", "url": long_url}).json()
print(r["shortenedUrl"])