Developer & Integration Suite

Tools & Developer Integrations

Automate URL shortening across your entire website, browser, and backend workflows with our robust REST API, full page script, and quick bookmarklets.

Your Active API Key:
YOUR_API_KEYManage in Settings →

API Endpoints Overview

Our REST API allows programmatic short URL creation, batch lookups, and click tracking retrieval. All endpoints require authentication via Bearer token.

POST/api/v1/urlsCreate a short URL with optional custom alias & password
GET/api/v1/urlsRetrieve your recent links and click statistics

cURL Request Example

curl -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"
  }'

JavaScript (Fetch)

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);

Python (Requests)

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 (cURL)

<?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"];
?>