This documentation explains how to use https://www.shorturls.pro/dev/api.php to get JSON output.
There are two ways to use the API:
alias parameter sent)alias parameter)https://www.shorturls.pro/dev/api.php
| Method | Endpoint | Description |
|---|---|---|
| GET | ?url={LONG_URL} | Create short URL with auto alias |
| GET | ?url={LONG_URL}&alias={ALIAS} | Create short URL with custom alias |
| Parameter | Required? | Description |
|---|---|---|
| url | Yes | The URL you want to shorten |
| alias | No | Custom alias for short URL |
{
"id": 188,
"alias": "wTNHgX",
"short_url": "https://sorts.pro/wTNHgX",
"long_url": "https://google.com",
"created_at": "2025-11-20T12:46:33+05:30",
"expires_at": null
}
{
"id": 190,
"alias": "qDKTpi",
"short_url": "https://sorts.pro/qDKTpi",
"long_url": "https://google.com",
"created_at": "2025-11-20T12:47:17+05:30",
"expires_at": null
}
| HTTP Code | JSON | Description |
|---|---|---|
| 400 | {"error":"missing url parameter"} | URL missing |
| 422 | {"error":"invalid url"} | URL invalid |
| 409 | {"error":"alias already taken"} | Alias exists |
| 500 | {"error":"server error"} | Server issue |
cURL – Auto Alias:
curl -G "https://www.shorturls.pro/dev/api.php" \
--data-urlencode "url=https://google.com"
cURL – Custom Alias:
curl -G "https://www.shorturls.pro/dev/api.php" \
--data-urlencode "url=https://google.com" \
--data-urlencode "alias=mygoogles"
JavaScript:
fetch('https://www.shorturls.pro/dev/api.php?url=' + encodeURIComponent('https://google.com'))
.then(r => r.json())
.then(console.log);
PHP:
<?php
$api = 'https://www.shorturls.pro/dev/api.php?url=' . urlencode('https://google.com');
$json = file_get_contents($api);
$data = json_decode($json, true);
print_r($data);
?>
| Field | Type | Description |
|---|---|---|
| id | integer | Record ID |
| alias | string | Generated/custom alias |
| short_url | string | Shortened URL |
| long_url | string | Original URL |
| created_at | datetime | Created timestamp |
© 2026 | shorturls.pro, sorts.to & sorts.live - all rights reserved.
Lasumeet Room Services (Opc) Pvt. Ltd.