DEVELOPERS
Free API for your tools and websites
One endpoint, one key, plain JSON. Shorten links from your own site, scripts or back end, free, up to 1000 links a month per account.
Get a key in two steps
- Sign in with Google. Signing in creates your account. Sign in
- Create your key. Open Profile → API access and press Create key.
Make a call
POST a JSON body with the URL and read shortUrl from the response. The same URL always returns the same short link, so retries are safe.
curl -X POST https://sha.boo/api/v1/shorten \
-H "Authorization: Bearer sb_your_api_key" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/some/page"}'const res = await fetch("https://sha.boo/api/v1/shorten", {
method: "POST",
headers: { Authorization: "Bearer sb_your_api_key", "Content-Type": "application/json" },
body: JSON.stringify({ url: "https://example.com/some/page" }),
});
const { shortUrl } = await res.json();
console.log(shortUrl);type ShortenResponse = { code: string; shortUrl: string };
const res = await fetch("https://sha.boo/api/v1/shorten", {
method: "POST",
headers: { Authorization: "Bearer sb_your_api_key", "Content-Type": "application/json" },
body: JSON.stringify({ url: "https://example.com/some/page" }),
});
const { shortUrl } = (await res.json()) as ShortenResponse;
console.log(shortUrl);import requests
res = requests.post(
"https://sha.boo/api/v1/shorten",
headers={"Authorization": "Bearer sb_your_api_key"},
json={"url": "https://example.com/some/page"},
)
print(res.json()["shortUrl"])using System.Net.Http.Headers;
using System.Net.Http.Json;
using var http = new HttpClient();
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "sb_your_api_key");
var res = await http.PostAsJsonAsync("https://sha.boo/api/v1/shorten", new { url = "https://example.com/some/page" });
var result = await res.Content.ReadFromJsonAsync<ShortenResponse>();
Console.WriteLine(result!.ShortUrl);
record ShortenResponse(string Code, string ShortUrl);Reference
Request
POST https://sha.boo/api/v1/shorten
| Authorization | Bearer sb_…, your API key. |
|---|---|
| Content-Type | application/json |
| Body | { "url": "https://example.com/page" }, up to 2048 characters. A missing scheme becomes https://. Links that embed a username or password are refused. |
Response
200 { "code": "AbC123xYz_-Q", "shortUrl": "https://sha.boo/l/AbC123xYz_-Q" }
Errors
| Status | Body | What it means |
|---|---|---|
| 400 | invalid json, url required, invalid url | Fix the request. Send JSON with the JSON content type; URLs must be http or https. |
| 401 | invalid api key | The key is missing, malformed, revoked or unknown. |
| 429 | rate limited | Burst limit: 10 calls per 10 seconds per account. Wait Retry-After seconds. |
| 429 | quota exceeded | Monthly limit reached. The body includes limit, used and resetsAt. |
| 500 | unable to shorten | Something broke on our side. Try again later. |
Good to know
- Free, 1000 new links a month. Repeats of a URL you already shortened don't count. The counter resets on the first of each month (UTC).
- Links are private. Links made with a key belong to your account but never appear on your dashboard or public page.
- Stored as given. The API does not strip tracking parameters. Clean the URL first if you want that.
- They last. Links live for 90 days, and each visit extends them.