Automate URL shortening across your entire website, browser, and backend workflows with our robust REST API, full page script, and quick bookmarklets.
Our REST API allows programmatic short URL creation, batch lookups, and click tracking retrieval. All endpoints require authentication via Bearer token.
/api/v1/urlsCreate a short URL with optional custom alias & password/api/v1/urlsRetrieve your recent links and click statisticscurl -X POST "https://s-mx.cc/api/v1/urls" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/very-long-target-link",
"custom": "my-promo-slug"
}'const response = await fetch("https://s-mx.cc/api/v1/urls", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
url: "https://example.com/my-page",
custom: "custom-slug"
})
});
const data = await response.json();
console.log("Shortened URL:", data.shorturl);import requests
url = "https://s-mx.cc/api/v1/urls"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"url": "https://example.com/my-page",
"custom": "custom-slug"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())<?php
$ch = curl_init("https://s-mx.cc/api/v1/urls");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer YOUR_API_KEY",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
"url" => "https://example.com/my-page",
"custom" => "custom-slug"
]));
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
echo $result["shorturl"];
?>