Learn how to integrate our URL shortening service into your applications.
All API requests require an API key. You can find your API key in your dashboard after logging in.
Authorization: Bearer YOUR_API_KEY
You can find your API key in your dashboard under the API section. If you don't have an API key yet, you can generate one there.
Create Short URL
Parameter | Type | Required | Description |
---|---|---|---|
long_url | string | Yes | The URL to be shortened |
curl -X POST https://i5o.io/api.php \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{"long_url": "https://example.com/very/long/url"}'
{ "status": "success", "short_url": "https://i5o.io/abc123", "qr_code": "https://i5o.io/qr/abc123" }
Get URL Statistics
curl https://i5o.io/api.php/stats/abc123 \ -H "Authorization: Bearer YOUR_API_KEY"
{ "status": "success", "data": { "short_code": "abc123", "long_url": "https://example.com/very/long/url", "created_at": "2025-01-07T12:00:00Z", "clicks": 42, "last_clicked": "2025-01-07T15:30:00Z" } }
To ensure fair usage of our API, rate limits are applied based on your account type.
Free accounts are limited to 60 requests per minute.
Account Type | Rate Limit |
---|---|
Basic (Free) | 60 requests per hour |
Plus | 300 requests per hour |
When an error occurs, the API returns an error object with a status code and message.
{ "status": "error", "code": "invalid_url", "message": "The provided URL is not valid." }
Error Code | Description |
---|---|
invalid_url | The provided URL is not valid |
unauthorized | Invalid or missing API key |
rate_limit_exceeded | You have exceeded your rate limit |
not_found | The requested resource was not found |
server_error | Internal server error |
$apiKey = 'YOUR_API_KEY'; $url = 'https://example.com/long/url'; $ch = curl_init('https://i5o.io/api.php'); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'Authorization: Bearer ' . $apiKey ], CURLOPT_POSTFIELDS => json_encode(['long_url' => $url]) ]); $response = curl_exec($ch); $data = json_decode($response, true); if ($data['status'] === 'success') { echo "Short URL: " . $data['short_url']; }
async function createShortUrl(longUrl) { const response = await fetch('https://i5o.io/api.php', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_API_KEY' }, body: JSON.stringify({ long_url: longUrl }) }); const data = await response.json(); if (data.status === 'success') { console.log('Short URL:', data.short_url); } }
import requests import json api_key = 'YOUR_API_KEY' url = 'https://example.com/long/url' headers = { 'Content-Type': 'application/json', 'Authorization': f'Bearer {api_key}' } data = { 'long_url': url } response = requests.post('https://i5o.io/api.php', headers=headers, data=json.dumps(data)) if response.status_code == 200: result = response.json() if result['status'] == 'success': print(f"Short URL: {result['short_url']}") else: print(f"Error: {response.status_code}")
If you have any questions or need assistance with our API, please don't hesitate to contact our support team.
Contact our support team at m.alshahrani584@gmail.com or visit our contact page for assistance.