🚀 API Documentation
The Qyntly API allows you to programmatically shorten URLs, retrieve statistics, and manage your links from any application.
Base URL:
https://qyntly.com/api/v1
🔑 Authentication
All API requests require an API key. You can generate one from your dashboard Settings page.
Option 1: Header (Recommended)
curl -H "X-API-Key: qyn_your_api_key_here" https://qyntly.com/api/v1/urls
Option 2: Query Parameter
curl "https://qyntly.com/api/v1/urls?api_key=qyn_your_api_key_here"
📊 Rate Limits
| Tier | Requests/Hour |
|---|---|
| Free | 100 |
| Pro | 1,000 |
Rate limit headers in every response:
X-RateLimit-Limit: Your tier's limitX-RateLimit-Remaining: Requests remainingX-RateLimit-Reset: When the limit resets (ISO 8601)
📌 Endpoints
POST /api/v1/bulk-shorten
Create multiple short URLs at once with optional suffix.
Request Body:
{
"urls": [
{ "name": "Leon", "url": "https://example.com" },
{ "name": "Pro", "url": "https://another.com" }
],
"suffix": "Leon" // Optional - appends to all names
}
Response (200 OK):
{
"success": true,
"created": 2,
"failed": 0,
"suffix": "Leon",
"results": [
{
"success": true,
"name": "Leon",
"url_code": "LeonLeon",
"short_url": "https://qyntly.com/LeonLeon",
"original_url": "https://example.com",
"qr_code": "https://qyntly.com/qr/LeonLeon"
},
{
"success": true,
"name": "Pro",
"url_code": "ProLeon",
"short_url": "https://qyntly.com/ProLeon",
"original_url": "https://another.com",
"qr_code": "https://qyntly.com/qr/ProLeon"
}
]
}
Example:
curl -X POST https://qyntly.com/api/v1/bulk-shorten \
-H "X-API-Key: qyn_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"urls": [
{"name": "Leon", "url": "https://example.com"},
{"name": "Pro", "url": "https://another.com"}
],
"suffix": "Leon"
}'
Notes:
- Maximum 100 URLs per request
- If
suffixis provided, it appends to each name (e.g.,Leon+Leon=LeonLeon) - If
suffixis omitted or empty, only the name is used - Each URL code must be unique - duplicates will be reported in
errors - Partial success possible - check both
resultsanderrors
POST /api/v1/shorten
Create a new short URL.
Request Body:
{
"url": "https://example.com/very/long/url",
"custom_code": "mylink" // Optional
}
Response (200 OK):
{
"success": true,
"data": {
"url_code": "abc123",
"short_url": "https://qyntly.com/abc123",
"original_url": "https://example.com/very/long/url",
"qr_code": "https://qyntly.com/qr/abc123",
"created_at": "2025-10-10T12:34:56.000Z"
}
}
Example:
curl -X POST https://qyntly.com/api/v1/shorten \
-H "X-API-Key: qyn_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/my-page"}'
GET /api/v1/url/:code
Retrieve information and stats for a specific short URL.
Response (200 OK):
{
"success": true,
"data": {
"url_code": "abc123",
"original_url": "https://example.com/my-page",
"short_url": "https://qyntly.com/abc123",
"clicks": 42,
"created_at": "2025-10-10T12:34:56.000Z"
}
}
Example:
curl https://qyntly.com/api/v1/url/abc123 \
-H "X-API-Key: qyn_your_api_key_here"
GET /api/v1/urls
Get a paginated list of all your short URLs.
Query Parameters:
limit(optional): Results per page (max 100, default 50)offset(optional): Pagination offset (default 0)
Response (200 OK):
{
"success": true,
"data": [
{
"url_code": "abc123",
"original_url": "https://example.com/page1",
"short_url": "https://qyntly.com/abc123",
"clicks": 42,
"created_at": "2025-10-10T12:34:56.000Z"
}
],
"pagination": {
"total": 150,
"limit": 50,
"offset": 0
}
}
Example:
curl "https://qyntly.com/api/v1/urls?limit=10&offset=0" \
-H "X-API-Key: qyn_your_api_key_here"
DELETE /api/v1/url/:code
Delete a short URL.
Response (200 OK):
{
"success": true,
"message": "URL deleted successfully"
}
Example:
curl -X DELETE https://qyntly.com/api/v1/url/abc123 \
-H "X-API-Key: qyn_your_api_key_here"
❌ Error Responses
All errors return JSON with an error field:
401 Unauthorized
{
"error": "Unauthorized",
"message": "API key required"
}
429 Rate Limit Exceeded
{
"error": "Rate limit exceeded",
"message": "Your free plan allows 100 requests per hour",
"resetAt": "2025-10-10T13:00:00.000Z"
}
403 Forbidden
{
"error": "URL limit reached",
"message": "Your free plan allows 100 URLs. Upgrade for more.",
"upgrade": true
}
💡 Code Examples
JavaScript (Node.js) - Bulk Create
const apiKey = 'qyn_your_api_key_here';
async function bulkShorten(urls, suffix = null) {
const response = await fetch('https://qyntly.com/api/v1/bulk-shorten', {
method: 'POST',
headers: {
'X-API-Key': apiKey,
'Content-Type': 'application/json'
},
body: JSON.stringify({ urls, suffix })
});
const data = await response.json();
console.log(`Created: ${data.created}, Failed: ${data.failed}`);
data.results.forEach(r => console.log(`${r.url_code} -> ${r.original_url}`));
return data;
}
// Example usage
bulkShorten([
{ name: 'Leon', url: 'https://example.com' },
{ name: 'Pro', url: 'https://another.com' }
], 'Leon');
JavaScript (Node.js) - Single URL
const apiKey = 'qyn_your_api_key_here';
async function shortenURL(url) {
const response = await fetch('https://qyntly.com/api/v1/shorten', {
method: 'POST',
headers: {
'X-API-Key': apiKey,
'Content-Type': 'application/json'
},
body: JSON.stringify({ url })
});
const data = await response.json();
console.log('Short URL:', data.data.short_url);
return data;
}
shortenURL('https://example.com/my-page');
Python - Bulk Create
import requests
API_KEY = 'qyn_your_api_key_here'
BASE_URL = 'https://qyntly.com/api/v1'
def bulk_shorten(urls, suffix=None):
headers = {'X-API-Key': API_KEY}
data = {'urls': urls}
if suffix:
data['suffix'] = suffix
response = requests.post(f'{BASE_URL}/bulk-shorten', headers=headers, json=data)
result = response.json()
print(f"Created: {result['created']}, Failed: {result['failed']}")
for item in result['results']:
print(f"{item['url_code']} -> {item['original_url']}")
return result
# Example usage
bulk_shorten([
{'name': 'Leon', 'url': 'https://example.com'},
{'name': 'Pro', 'url': 'https://another.com'}
], 'Leon')
Python - Single URL
import requests
API_KEY = 'qyn_your_api_key_here'
BASE_URL = 'https://qyntly.com/api/v1'
def shorten_url(url):
headers = {'X-API-Key': API_KEY}
data = {'url': url}
response = requests.post(f'{BASE_URL}/shorten', headers=headers, json=data)
result = response.json()
print(f"Short URL: {result['data']['short_url']}")
return result
shorten_url('https://example.com/my-page')
PHP
<?php
$apiKey = 'qyn_your_api_key_here';
$url = 'https://example.com/my-page';
$ch = curl_init('https://qyntly.com/api/v1/shorten');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-Key: ' . $apiKey,
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['url' => $url]));
$response = curl_exec($ch);
$data = json_decode($response, true);
echo "Short URL: " . $data['data']['short_url'] . "\n";
curl_close($ch);
?>
🔒 Security Best Practices
- Never commit API keys to version control
- Use environment variables to store keys
- Regenerate keys if compromised
- Use HTTPS for all requests
- Implement retry logic with exponential backoff
- Monitor rate limits in response headers
📞 Support
- Dashboard: https://qyntly.com/dashboard.html
- Generate API Keys: Go to Settings in your dashboard
Happy shortening! 🔗