Complete reference for the Krenla REST API: URL shortening, analytics, bot commands, and more.
Authenticate with username and password to obtain an API key.
| Parameter | Type | Required | Description |
|---|---|---|---|
| username | string | required | Your Krenla username |
| password | string | required | Your Krenla password |
curl -X POST https://krenla.com/api/v1/auth \
-H "Content-Type: application/json" \
-d '{"username":"your_username","password":"your_password"}'
{
"success": true,
"apiKey": "krenla_AbCdEfGhIjKlMnOpQrStUvWxYz123456",
"permissions": ["shorten", "read", "delete", "analytics"],
"message": "Authentication successful"
}
Create a shortened URL with advanced options including custom codes, expiration, and password protection.
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | required | The URL to shorten |
| custom | string | optional | Custom short code (3-20 chars) |
| expiresIn | integer | optional | Expiration time in seconds |
| password | string | optional | Password to protect the URL |
| maxClicks | integer | optional | Maximum number of clicks allowed |
| title | string | optional | Title for the shortened URL |
curl -X POST https://krenla.com/api/v1/shorten \
-H "X-API-Key: krenla_AbCdEfGhIjKlMnOpQrStUvWxYz123456" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/long","custom":"mycool","expiresIn":604800,"title":"My Cool URL"}'
{
"success": true,
"code": "mycool",
"shortUrl": "https://krenla.com/s/mycool",
"originalUrl": "https://example.com/very/long/url",
"expiresAt": "2026-01-01T00:00:00.000Z",
"title": "My Cool URL"
}
Get a paginated list of all URLs you have shortened.
| Parameter | Type | Required | Description |
|---|---|---|---|
| page | integer | optional | Page number (default: 1) |
| limit | integer | optional | Items per page (default: 20, max: 100) |
| search | string | optional | Search by URL or code |
curl -X GET "https://krenla.com/api/v1/urls?page=1&limit=10" \ -H "X-API-Key: krenla_AbCdEfGhIjKlMnOpQrStUvWxYz123456"
{
"success": true,
"urls": [
{
"code": "mycool",
"originalUrl": "https://example.com/long",
"title": "My Cool URL",
"clicks": 42,
"uniqueClicks": 38,
"createdAt": "2025-01-01T00:00:00.000Z",
"isActive": true
}
],
"pagination": { "total": 15, "page": 1, "limit": 10, "totalPages": 2 }
}
Get detailed information about a specific shortened URL.
curl -X GET https://krenla.com/api/v1/url/mycool \ -H "X-API-Key: krenla_AbCdEfGhIjKlMnOpQrStUvWxYz123456"
{
"success": true,
"url": {
"code": "mycool",
"originalUrl": "https://example.com/long",
"title": "My Cool URL",
"clicks": 42,
"uniqueClicks": 38,
"createdAt": "2025-01-01T00:00:00.000Z",
"expiresAt": "2026-01-01T00:00:00.000Z",
"isActive": true,
"hasPassword": false,
"maxClicks": null,
"tags": []
}
}
Update settings for a shortened URL (title, password, max clicks, etc.).
| Parameter | Type | Required | Description |
|---|---|---|---|
| title | string | optional | New title |
| password | string | optional | Set or remove password (null to remove) |
| maxClicks | integer | optional | Update max click limit |
| isActive | boolean | optional | Activate or deactivate the URL |
curl -X PUT https://krenla.com/api/v1/url/mycool \
-H "X-API-Key: krenla_AbCdEfGhIjKlMnOpQrStUvWxYz123456" \
-H "Content-Type: application/json" \
-d '{"title":"Updated Title","maxClicks":100}'
{
"success": true,
"message": "URL updated successfully",
"url": { "code": "mycool", "title": "Updated Title", "isActive": true }
}
Permanently delete a shortened URL and all associated analytics data.
curl -X DELETE https://krenla.com/api/v1/url/mycool \ -H "X-API-Key: krenla_AbCdEfGhIjKlMnOpQrStUvWxYz123456"
{
"success": true,
"message": "URL deleted successfully"
}
Get detailed analytics data for a shortened URL including clicks, referrers, browsers, devices, and more.
curl -X GET https://krenla.com/api/v1/analytics/mycool \ -H "X-API-Key: krenla_AbCdEfGhIjKlMnOpQrStUvWxYz123456"
{
"success": true,
"analytics": {
"totalClicks": 42,
"uniqueClicks": 38,
"avgClicksPerDay": 6.2,
"isTrending": true,
"topReferrers": [["reddit.com", 15], ["twitter.com", 8]],
"topBrowsers": [["Chrome", 25], ["Firefox", 10]],
"devices": { "Desktop": 28, "Mobile": 10, "Tablet": 4 },
"trends": [
{ "date": "2025-12-25", "clicks": 5, "unique": 4 },
{ "date": "2025-12-26", "clicks": 8, "unique": 7 }
],
"last30Days": []
}
}
Get your account statistics including total URLs, total clicks, and API usage.
curl -X GET https://krenla.com/api/v1/stats \ -H "X-API-Key: krenla_AbCdEfGhIjKlMnOpQrStUvWxYz123456"
{
"success": true,
"stats": {
"totalUrls": 15,
"totalClicks": 247,
"totalUniqueClicks": 201,
"apiUsage": 156,
"dailyUsage": 12,
"rateLimit": 1000,
"remaining": 988
}
}
Health check endpoint for bot monitoring.
curl https://krenla.com/api/bot/health
{ "status": "ok", "timestamp": "2026-01-01T00:00:00.000Z" }
Get overall platform statistics (models, users, views, posts).
curl https://krenla.com/api/bot/stats
{
"totalModels": 120,
"totalImages": 4500,
"totalVideos": 320,
"totalViews": 152000,
"totalUsers": 850,
"totalForumPosts": 240,
"totalPiyPosts": 180
}
Look up a model by name (exact or partial match).
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | required | Model name to search |
curl "https://krenla.com/api/bot/model?name=sophie"
{
"found": true,
"model": {
"name": "Sophie Rain",
"slug": "sophie-rain",
"brand": "pack",
"year": 2026,
"views": 1200,
"likes": 340,
"thumbnail": "https://..."
}
}
Get a random model.
curl https://krenla.com/api/bot/random
{ "found": true, "model": { "name": "...", "slug": "..." } }
Get the most liked models.
| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | integer | optional | Number of results (default 10) |
curl "https://krenla.com/api/bot/most-liked?limit=5"
{ "models": [ { "name": "...", "likes": 500 } ] }
Get the most viewed models.
| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | integer | optional | Number of results (default 10) |
curl "https://krenla.com/api/bot/most-views?limit=5"
{ "models": [ { "name": "...", "views": 5000 } ] }
Search models by name, brand, or type.
| Parameter | Type | Required | Description |
|---|---|---|---|
| q | string | required | Search query |
curl "https://krenla.com/api/bot/search?q=sophie"
{ "results": [ { "name": "...", "slug": "..." } ], "total": 3 }
Get stats for a specific user.
| Parameter | Type | Required | Description |
|---|---|---|---|
| username | string | required | Username to look up |
curl "https://krenla.com/api/bot/user-stats?username=admin"
{
"found": true,
"user": { "username": "admin", "followers": 50, "following": 10, "piyPosts": 12, "forumPosts": 24 }
}
Get full model details including specs and description.
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | required | Model name |
curl "https://krenla.com/api/bot/model-details?name=sophie"
{ "found": true, "model": { "name": "...", "specs": "...", "description": "..." } }
All endpoints are rate limited per API key to ensure fair usage across all users.
Rate Limit Headers: Every response includes X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers so you can track your usage.
Standard HTTP status codes returned by the API.
| Status | Name | Description |
|---|---|---|
| 400 | Bad Request | Invalid parameters or missing required fields |
| 401 | Unauthorized | Missing or invalid API key |
| 403 | Forbidden | Valid key but insufficient permissions |
| 404 | Not Found | Requested resource does not exist |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Something went wrong on our side |
Error format: All errors return JSON with success: false, an error field, and a human-readable message.
All protected endpoints require an API key. Here's how to get and use one.
Call POST /api/v1/auth with your Krenla username and password. You'll receive an API key starting with krenla_.
Pass the API key in every request via the X-API-Key header:
X-API-Key: krenla_AbCdEfGhIjKlMnOpQrStUvWxYz123456
Never commit API keys to git or expose them client-side. Store them in environment variables or a secrets manager.