API Documentation
Integrate our URL shortening service into your applications with our powerful, easy-to-use API
API Reference
Complete documentation for integrating with our URL shortening service
Overview
https://adcode.nabzclan.vip/api/
Our API accepts both GET and POST requests. All responses are returned in JSON format.
For production use, we recommend using POST requests with JSON data for better security and flexibility.
API Endpoints
Create a Basic Shortened URL Now with Time-Based IDs
Parameters:
The URL to shorten (must start with http:// or https://)
Example: https://example.com/very/long/path
The API now properly handles complex URLs with query parameters and hash fragments.
Example: https://example.com/search?query=test&page=2#results
skips the json response page and sends them directly to the adcode page
is_existing: true
to indicate this.
Example Response:
{
"status": "success",
"longurl": "https://example.com/very/long/path",
"adcodeurl": "https://adcode.nabzclan.vip/link/7c3c21bvq549Pd8m378d",
"stats": "https://adcode.nabzclan.vip/stats/?id=7c3c21bvq549Pd8m378d",
"is_existing": false
}
Create a Password-Protected Shortened URL Now with Time-Based IDs
Parameters:
The URL to shorten (must start with http:// or https://)
Example: https://example.com/very/long/path
The API now properly handles complex URLs with query parameters and hash fragments.
Example: https://example.com/search?query=test&page=2#results
skips the json response page and sends them directly to the adcode page
Password to protect the URL (alphanumeric, underscore, dash only)
Example: my_secure_pass123
Example Response:
{
"status": "success",
"longurl": "https://example.com/very/long/path",
"adcodeurl": "https://adcode.nabzclan.vip/link/7c3c21bvq549Pd8m378d",
"stats": "https://adcode.nabzclan.vip/stats/?id=7c3c21bvq549Pd8m378d",
"is_existing": false
}
Create URL (Recommended Method) Now with Time-Based IDs
Request Body (JSON):
{
"url": "https://example.com/very/long/path",
"pass": "optional_password" // Optional
}
Example Response:
{
"status": "success",
"longurl": "https://example.com/very/long/path",
"adcodeurl": "https://adcode.nabzclan.vip/link/427d52kvq3l9za8m712p",
"stats": "https://adcode.nabzclan.vip/stats/?id=427d52kvq3l9za8m712p",
"is_existing": false
}
Example Response (Existing URL):
{
"status": "success",
"longurl": "https://example.com/very/long/path",
"adcodeurl": "https://adcode.nabzclan.vip/link/427d52kvq3l9za8m712p",
"stats": "https://adcode.nabzclan.vip/stats/?id=427d52kvq3l9za8m712p",
"is_existing": true
}
Error Responses
In case of an error, the API will return a JSON response with an error message:
{
"status": "error",
"message": "Invalid URL format"
}
Common Error Messages:
- Missing parameter 'url'
- Invalid URL format
- Invalid password format
- Database error
- Rate limit exceeded
HTTP Status Codes:
- 200 Success - The request was processed successfully
- 400 Bad Request - Invalid parameters
- 429 Too Many Requests - Rate limit exceeded
- 500 Internal Server Error - Server-side error
Integration Examples
Start integrating with copy-paste ready code examples
PHP Example
<?php
// Create a basic shortened URL
$longUrl = "https://example.com/very/long/url-that-needs-shortening";
$apiUrl = "https://adcode.nabzclan.vip/api/?url=" . urlencode($longUrl);
// For password protection
// $apiUrl = "https://adcode.nabzclan.vip/api/?url=" . urlencode($longUrl) . "&pass=myPassword";
// Using file_get_contents (simple approach)
$response = file_get_contents($apiUrl);
$data = json_decode($response, true);
if ($data['status'] === 'success') {
echo "Shortened URL: " . $data['adcodeurl'];
} else {
echo "Error: " . $data['message'];
}
// Alternative: Using cURL (recommended for production)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://adcode.nabzclan.vip/api/");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'url' => $longUrl,
'pass' => 'optional_password' // Remove this line if not using password
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
// Process the response as shown above
?>
Need Help?
If you need any assistance with implementing the API or have any questions, feel free to contact our support team via the contact form.