Public API · Free · No auth required
Sniplinks REST API
One endpoint. JSON in, JSON out. CORS open. No tokens, no signup, no dashboards. Drop it into a script, a bot, a CLI, or your own app in 60 seconds.
Endpoint
POST
https://sniplinks.in/api/public/v1/shorten- Request body
- {
"url": "https://example.com",
"alias": "optional-code"
} - Constraints
·
url— http(s), 8–2048 chars·
alias— optional, 4–32 chars,[A-Za-z0-9_-]·
409if the alias is taken
curl
curl -X POST https://sniplinks.in/api/public/v1/shorten \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/very/long/path?with=params"}' JavaScript / fetch
const res = await fetch("https://sniplinks.in/api/public/v1/shorten", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
url: "https://example.com/long/url",
alias: "my-link", // optional, 4–32 chars [A-Za-z0-9_-]
}),
});
const data = await res.json();
console.log(data.short_url); // https://sniplinks.in/my-link Response (201 Created)
{
"code": "uvtaG4",
"short_url": "https://sniplinks.in/uvtaG4",
"preview_url": "https://sniplinks.in/uvtaG4+",
"stats_url": "https://sniplinks.in/uvtaG4/stats",
"url": "https://example.com/very/long/path?with=params"
} One-click bookmarklet
Shorten the current tab in one click
Drag the button below to your bookmarks bar. Click it on any page to shorten that URL and copy it to your clipboard.
Snip this page
(Drag — don't click — to add to your bookmarks bar.)
Status codes
201— created, returns the short link object400— invalid JSON, invalid URL, or shortening a Sniplinks URL409— the alias is already taken or reserved500— database hiccup; safe to retry
Need to know what's new? See the changelog →Back to the shortener →