API Documentation

RESTful API for URL shortening, analytics, and management

Overview

The URL Shortener Pro API allows you to programmatically create, manage, and track shortened URLs.

Quick GET API Example

Shorten any URL instantly via browser or single HTTP GET request:

https://url.utts.in/api-create.php?api_key=YOUR_API_KEY&url=https://google.com
Base URL: https://url.utts.in/api/

Features

  • Create shortened URLs
  • Custom short codes (Premium)
  • Password-protected links (Premium)
  • Get URL statistics
  • List all your URLs
  • Delete URLs
  • Bulk operations (Premium)

Authentication & Access Tiers

We provide four levels of API access depending on your account type:

Guest

No authentication required.

  • Endpoint: /api/public/shorten
  • Rate Limit: Unlimited (Fair Use)
  • Link Expiry: 12 hours
Free User

Requires API Key.

  • Standard Endpoints
  • Rate Limit: 999999 requests/hour
  • Link Expiry: 24 hours
  • Standard Analytics
Premium

Requires API Key.

  • All Free features
  • Rate Limit: Unlimited
  • Link Expiry: Customizable / Never
  • Custom Slugs & Passwords
  • /api/bulk-shorten
Admin

Requires API Key.

  • All Premium features
  • Rate Limit: Unlimited
  • Link Expiry: Customizable / Never
  • Access to ALL user links
  • Global deletion rights
Login to view your API key and upgrade your access.
How to Authenticate (Registered Users)

You can authenticate using an HTTP Header or via GET Query Parameter:

# Option 1: Via Authorization Header
Authorization: Bearer YOUR_API_KEY

# Option 2: Via GET Query Parameter
https://url.utts.in/api-create.php?api_key=YOUR_API_KEY&url=https://google.com

Rate Limits & Headers

Rate limit headers are included in all API responses to help you track your usage:

X-RateLimit-Limit: 999999X-RateLimit-Remaining: 999998X-RateLimit-Reset: 1643723400

If you exceed your rate limit, the API will return a 429 Too Many Requests status code.

Public & Simple GET API

GET /api-create.php SIMPLE GET

A simple, plain-text API that returns the short URL directly as plain text. Perfect for quick integrations, Telegram/WhatsApp bots, and simple scripts.

Request Parameters
Parameter Type Required Description
url string ✅ Required The long URL to shorten (URL encoded)
api_key string ⚡ Optional Your user API key (for user account tracking, rate limit & custom expiry)
Example Request (Public / Guest)
curl -X GET "https://url.utts.in/api-create.php?url=https://google.com"
Example Request (With API Key)
curl -X GET "https://url.utts.in/api-create.php?api_key=YOUR_API_KEY&url=https://google.com"
Example Response (Plain Text)
https://url.utts.in/abc123
GET /api.php?url=YOUR_URL GUEST

Shorten a URL via a simple GET request and receive a structured JSON response.

Request Parameters
Parameter Type Required Description
url string The long URL to shorten (URL encoded)
Example Request
curl -X GET "https://url.utts.in/api.php?url=https://github.com/username/repo"
Example Response (JSON)
{
    "success": true,
    "short_url": "https://url.utts.in/abc123",
    "short_code": "abc123",
    "original_url": "https://github.com/username/repo",
    "expires_at": "2026-09-12 20:18:24"
}
POST /api/public/shorten GUEST

Shorten a URL without authentication. Links expire in 12 hours. Rate Limit is Unlimited for fair use.

Request Body
Parameter Type Required Description
url string The long URL to shorten
Example Request
curl -X POST https://url.utts.in/api/public/shorten \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/very-long-url"}'
Example Response
{
  "success": true,
  "data": {
    "short_code": "abc123",
    "short_url": "https://url.utts.in/abc123",
    "original_url": "https://example.com/very-long-url",
    "expires_at": "2024-02-01 18:00:00"
  },
  "rate_limit": {
    "limit": 999999,
    "remaining": 9
  }
}

Authenticated API

All endpoints require Authorization: Bearer YOUR_API_KEY header

POST /api/shorten FREE PREMIUM ADMIN

Create a shortened URL with optional custom slug and password protection (Premium only).

Request Body
Parameter Type Required Description
url string The long URL to shorten
custom_slug string Custom short code (Premium only)
description string Description for the URL
password string Password to protect the link (Premium only)
fallback_url string Fallback URL for geolocation/devices (Premium only)
expires_at datetime Custom expiration time e.g., 2024-12-31 23:59:59 (Premium only)
Example Request
curl -X POST https://url.utts.in/api/shorten \
  -H "Authorization: Bearer 0d5ddafdda86ed54643056e5f5fe9e5f4e9f49e4f9egd0bf7af56c3cf4ce74828" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://github.com/username/repo",
    "custom_slug": "my-repo",
    "description": "My GitHub Repo"
  }'
Example Response
{
  "success": true,
  "data": {
    "short_code": "my-repo",
    "short_url": "https://url.utts.in/my-repo",
    "original_url": "https://github.com/username/repo",
    "expires_at": "2024-03-01 10:00:00"
  }
}
GET /api/stats/{short_code} FREE PREMIUM ADMIN

Get detailed statistics for a shortened URL.

Example Request
curl -X GET https://url.utts.in/api/stats/abc123 \
  -H "Authorization: Bearer 0d5ddafdda86ed54643056e5f5fe9e5f4e9f49e4f9egd0bf7af56c3cf4ce74828"
Example Response
{
  "success": true,
  "data": {
    "short_code": "abc123",
    "original_url": "https://example.com",
    "total_clicks": 150,
    "unique_clicks": 87,
    "created_at": "2024-01-15 10:30:00",
    "expires_at": "2024-02-15 10:30:00",
    "clicks_by_country": {
      "India": 65,
      "United States": 45,
      "United Kingdom": 25
    },
    "clicks_by_device": {
      "mobile": 90,
      "desktop": 50,
      "tablet": 10
    },
    "clicks_by_browser": {
      "Chrome": 80,
      "Safari": 40,
      "Firefox": 20,
      "Edge": 10
    }
  }
}
GET /api/links FREE PREMIUM ADMIN

Get a paginated list of all your shortened URLs.

Query Parameters
Parameter Type Default Description
page integer 1 Page number
per_page integer 20 Items per page (max 100)
Example Request
curl -X GET "https://url.utts.in/api/links?page=1&per_page=20" \
  -H "Authorization: Bearer 0d5ddafdda86ed54643056e5f5fe9e5f4e9f49e4f9egd0bf7af56c3cf4ce74828"
DELETE /api/delete/{short_code} FREE PREMIUM ADMIN

Delete a shortened URL.

Example Request
curl -X DELETE https://url.utts.in/api/delete/abc123 \
  -H "Authorization: Bearer 0d5ddafdda86ed54643056e5f5fe9e5f4e9f49e4f9egd0bf7af56c3cf4ce74828"
Example Response
{
  "success": true,
  "message": "URL deleted successfully"
}
POST /api/bulk-shorten PREMIUM ADMIN

Shorten multiple URLs in one request (Premium only).

Request Body
Parameter Type Required Description
urls array Array of URLs to shorten
Example Request
curl -X POST https://url.utts.in/api/bulk-shorten \
  -H "Authorization: Bearer 0d5ddafdda86ed54643056e5f5fe9e5f4e9f49e4f9egd0bf7af56c3cf4ce74828" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": [
      "https://example1.com",
      "https://example2.com",
      "https://example3.com"
    ]
  }'

Error Codes

Status Code Meaning
200 Success
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid or missing API key
403 Forbidden - Premium feature, upgrade required
404 Not Found - Resource doesn't exist
422 Unprocessable Entity - Validation failed
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error
Error Response Format
{
  "success": false,
  "error": "Error message describing what went wrong"
}

Code Examples

Direct Browser / GET API Example

Pass your api_key and target url as query parameters:

# Plain-Text Output (Returns short URL directly)
https://url.utts.in/api-create.php?api_key=YOUR_API_KEY&url=https://google.com

# Example Call:
https://url.utts.in/api-create.php?api_key=0d5ddafdda86ed54643056e5f5fe9e5f4e9f49e4f9egd0bf7af56c3cf4ce74828&url=https://google.com
JSON Output Example
# JSON Output Format
https://url.utts.in/api.php?url=https://google.com
1. Simple GET Request (Plain Text Output)
curl -X GET "https://url.utts.in/api-create.php?api_key=0d5ddafdda86ed54643056e5f5fe9e5f4e9f49e4f9egd0bf7af56c3cf4ce74828&url=https://google.com"
2. POST Request (JSON Output)
curl -X POST https://url.utts.in/api/shorten \
  -H "Authorization: Bearer 0d5ddafdda86ed54643056e5f5fe9e5f4e9f49e4f9egd0bf7af56c3cf4ce74828" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://google.com", "description": "Example Link"}'
1. Simple GET Request
// Simple GET request returning plain-text short URL
const apiKey = '0d5ddafdda86ed54643056e5f5fe9e5f4e9f49e4f9egd0bf7af56c3cf4ce74828';
const targetUrl = encodeURIComponent('https://google.com');

fetch(`https://url.utts.in/api-create.php?api_key=${apiKey}&url=${targetUrl}`)
  .then(response => response.text())
  .then(shortUrl => console.log('Shortened URL:', shortUrl))
  .catch(error => console.error('Error:', error));
2. POST JSON Request
const apiKey = '0d5ddafdda86ed54643056e5f5fe9e5f4e9f49e4f9egd0bf7af56c3cf4ce74828';

fetch('https://url.utts.in/api/shorten', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${apiKey}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    url: 'https://google.com'
  })
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
1. Simple GET Request
import requests

api_key = '0d5ddafdda86ed54643056e5f5fe9e5f4e9f49e4f9egd0bf7af56c3cf4ce74828'
long_url = 'https://google.com'

response = requests.get(f'https://url.utts.in/api-create.php?api_key={api_key}&url={long_url}')
print("Short URL:", response.text.strip())
2. POST Request
import requests

api_key = '0d5ddafdda86ed54643056e5f5fe9e5f4e9f49e4f9egd0bf7af56c3cf4ce74828'
headers = {
    'Authorization': f'Bearer {api_key}',
    'Content-Type': 'application/json'
}
data = {'url': 'https://google.com'}

response = requests.post('https://url.utts.in/api/shorten', headers=headers, json=data)
print(response.json())
1. Simple GET Request (file_get_contents)
<?php
$apiKey = '0d5ddafdda86ed54643056e5f5fe9e5f4e9f49e4f9egd0bf7af56c3cf4ce74828';
$longUrl = urlencode('https://google.com');

$shortUrl = file_get_contents("https://url.utts.in/api-create.php?api_key={$apiKey}&url={$longUrl}");
echo "Short URL: " . $shortUrl;
?>
2. cURL POST Request
<?php
$apiKey = '0d5ddafdda86ed54643056e5f5fe9e5f4e9f49e4f9egd0bf7af56c3cf4ce74828';
$apiUrl = 'https://url.utts.in/api/shorten';

$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['url' => 'https://google.com']));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $apiKey,
    'Content-Type: application/json'
]);

$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
Need Help?

If you have questions or need support: