Our REST API allows you to programmatically create short URLs from your applications. The API is simple to use and returns JSON responses.
Base URL: https://reviwe-tryt-lnk.site/api
Create a new short URL.
| Header | Value | Required |
|---|---|---|
Content-Type |
application/json |
Yes |
X-API-Key |
Your API key | Yes |
{
"url": "https://example.com/very/long/url",
"custom_alias": "my-link", // Optional
"expires_at": "2024-12-31", // Optional (YYYY-MM-DD format)
"redirect_type": "302" // Optional (301 or 302)
}
{
"success": true,
"short_code": "abc123",
"short_url": "https://reviwe-tryt-lnk.site/abc123",
"long_url": "https://example.com/very/long/url"
}
Get information about a short URL.
| Header | Value | Required |
|---|---|---|
X-API-Key |
Your API key | Yes |
{
"short_code": "abc123",
"long_url": "https://example.com/very/long/url",
"clicks": 42,
"created_at": "2024-01-15 10:30:00"
}
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid input data |
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - API access disabled |
| 404 | Not Found - Short code doesn't exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Server Error - Something went wrong |
curl -X POST https://reviwe-tryt-lnk.site/api/shorten \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{"url": "https://example.com/very/long/url"}'
fetch('https://reviwe-tryt-lnk.site/api/shorten', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your_api_key_here'
},
body: JSON.stringify({
url: 'https://example.com/very/long/url'
})
})
.then(response => response.json())
.then(data => console.log(data));
$ch = curl_init('https://reviwe-tryt-lnk.site/api/shorten');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'url' => 'https://example.com/very/long/url'
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'X-API-Key: your_api_key_here'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);