URL Shortener

Create short, memorable links with built-in analytics. Track clicks, geographic locations, referrers, and user behavior in real-time.

GEO IP TrackingClick AnalyticsCustom Codes

API Endpoint

GEThttps://xhp.cz/api/shorten

Parameters

ParameterTypeRequiredDescription
urlstringRequiredThe URL to shorten (must include http:// or https://)
customstringOptionalCustom short code (3-20 characters, alphanumeric only)

Examples

Basic URL Shortening

Shorten a URL with an auto-generated code

GET https://xhp.cz/api/shorten?url=https://bizkithub.com

Response:

{
  "success": true,
  "data": {
    "short_url": "https://xhp.cz/abc123",
    "original_url": "https://bizkithub.com",
    "short_code": "abc123",
    "created_at": "2025-01-15T10:30:00Z"
  }
}

Custom Short Code

Create a branded short link with your own code

GET https://xhp.cz/api/shorten?url=https://bizkithub.com&custom=bizkithub

Response:

{
  "success": true,
  "data": {
    "short_url": "https://xhp.cz/bizkithub",
    "original_url": "https://bizkithub.com",
    "short_code": "bizkithub",
    "created_at": "2025-01-15T10:30:00Z"
  }
}

Analytics & Tracking

Automatic Tracking

Every shortened URL automatically tracks clicks, geographic location, referrers, and user agents. Access analytics by appending + to any short URL.

Total clicks and unique visitors
Geographic location (country, city)
Referrer websites
Click timestamps and patterns

Analytics Access

View analytics in browser:

https://xhp.cz/abc123+

JSON API endpoint:

https://xhp.cz/api/stats/abc123

JavaScript Integration

async function shortenURL(originalUrl, customCode = null) {
  const params = new URLSearchParams({ url: originalUrl });
  if (customCode) {
    params.append('custom', customCode);
  }

  const response = await fetch(`https://xhp.cz/api/shorten?${params}`);
  const data = await response.json();

  if (data.success) {
    return data.data.short_url;
  } else {
    throw new Error(data.error || 'Failed to shorten URL');
  }
}

async function getAnalytics(shortCode) {
  const response = await fetch(`https://xhp.cz/api/stats/${shortCode}`);
  return await response.json();
}

// Usage examples
try {
  const shortUrl = await shortenURL('https://bizkithub.com');
  console.log('Shortened URL:', shortUrl);

  const customUrl = await shortenURL('https://bizkithub.com', 'bizkithub');
  console.log('Custom URL:', customUrl);

  const stats = await getAnalytics('abc123');
  console.log('Analytics:', stats);
} catch (error) {
  console.error('Error:', error.message);
}

Rate Limits

500
URLs per hour
Unlimited
Click tracking
Never
URL expiration
Free
Analytics access

Error Handling

400Bad Request

Invalid URL format or missing parameters

409Conflict

Custom short code already exists

429Too Many Requests

Rate limit exceeded, please try again later

Advanced Features

GEO IP Tracking

Automatically detect and track the geographic location of visitors, including country, region, and city information for detailed audience insights.

Real-time Analytics

Get instant access to click statistics, referrer data, and user behavior patterns through our analytics API and web dashboard.