Welcome and thanks for using krenla.com!
Next big update will be at 150 registered users.. Have fun!
Developer Documentation

Krenla API

Complete reference for the Krenla REST API: URL shortening, analytics, bot commands, and more.

https://krenla.com/api
3
API Groups
17
Endpoints
1,000
Requests / Day
v1
Current Version

Authentication

1 endpoint
POST /api/v1/auth Public

Authenticate with username and password to obtain an API key.

Request Body

ParameterTypeRequiredDescription
username string required Your Krenla username
password string required Your Krenla password

Example Request

curl -X POST https://krenla.com/api/v1/auth \
  -H "Content-Type: application/json" \
  -d '{"username":"your_username","password":"your_password"}'

Response

200 OK
{
  "success": true,
  "apiKey": "krenla_AbCdEfGhIjKlMnOpQrStUvWxYz123456",
  "permissions": ["shorten", "read", "delete", "analytics"],
  "message": "Authentication successful"
}

URL Shortening

5 endpoints
POST /api/v1/shorten Auth Required

Create a shortened URL with advanced options including custom codes, expiration, and password protection.

Request Body

ParameterTypeRequiredDescription
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

Example Request

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"}'

Response

200 OK
{
  "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 /api/v1/urls Auth Required

Get a paginated list of all URLs you have shortened.

Query Parameters

ParameterTypeRequiredDescription
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

Example Request

curl -X GET "https://krenla.com/api/v1/urls?page=1&limit=10" \
  -H "X-API-Key: krenla_AbCdEfGhIjKlMnOpQrStUvWxYz123456"

Response

200 OK
{
  "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 /api/v1/url/{code} Auth Required

Get detailed information about a specific shortened URL.

Example Request

curl -X GET https://krenla.com/api/v1/url/mycool \
  -H "X-API-Key: krenla_AbCdEfGhIjKlMnOpQrStUvWxYz123456"

Response

200 OK
{
  "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": []
  }
}
PUT /api/v1/url/{code} Auth Required

Update settings for a shortened URL (title, password, max clicks, etc.).

Request Body

ParameterTypeRequiredDescription
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

Example Request

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}'

Response

200 OK
{
  "success": true,
  "message": "URL updated successfully",
  "url": { "code": "mycool", "title": "Updated Title", "isActive": true }
}
DELETE /api/v1/url/{code} Auth Required

Permanently delete a shortened URL and all associated analytics data.

Example Request

curl -X DELETE https://krenla.com/api/v1/url/mycool \
  -H "X-API-Key: krenla_AbCdEfGhIjKlMnOpQrStUvWxYz123456"

Response

200 OK
{
  "success": true,
  "message": "URL deleted successfully"
}

Analytics

2 endpoints
GET /api/v1/analytics/{code} Auth Required

Get detailed analytics data for a shortened URL including clicks, referrers, browsers, devices, and more.

Example Request

curl -X GET https://krenla.com/api/v1/analytics/mycool \
  -H "X-API-Key: krenla_AbCdEfGhIjKlMnOpQrStUvWxYz123456"

Response

200 OK
{
  "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 /api/v1/stats Auth Required

Get your account statistics including total URLs, total clicks, and API usage.

Example Request

curl -X GET https://krenla.com/api/v1/stats \
  -H "X-API-Key: krenla_AbCdEfGhIjKlMnOpQrStUvWxYz123456"

Response

200 OK
{
  "success": true,
  "stats": {
    "totalUrls": 15,
    "totalClicks": 247,
    "totalUniqueClicks": 201,
    "apiUsage": 156,
    "dailyUsage": 12,
    "rateLimit": 1000,
    "remaining": 988
  }
}

Bot API

9 endpoints
GET /api/bot/health Public

Health check endpoint for bot monitoring.

Example Request

curl https://krenla.com/api/bot/health

Response

200 OK
{ "status": "ok", "timestamp": "2026-01-01T00:00:00.000Z" }
GET /api/bot/stats Public

Get overall platform statistics (models, users, views, posts).

Example Request

curl https://krenla.com/api/bot/stats

Response

200 OK
{
  "totalModels": 120,
  "totalImages": 4500,
  "totalVideos": 320,
  "totalViews": 152000,
  "totalUsers": 850,
  "totalForumPosts": 240,
  "totalPiyPosts": 180
}
GET /api/bot/model?name={name} Public

Look up a model by name (exact or partial match).

Query Parameters

ParameterTypeRequiredDescription
name string required Model name to search

Example Request

curl "https://krenla.com/api/bot/model?name=sophie"

Response

200 OK
{
  "found": true,
  "model": {
    "name": "Sophie Rain",
    "slug": "sophie-rain",
    "brand": "pack",
    "year": 2026,
    "views": 1200,
    "likes": 340,
    "thumbnail": "https://..."
  }
}
GET /api/bot/random Public

Get a random model.

Example Request

curl https://krenla.com/api/bot/random

Response

200 OK
{ "found": true, "model": { "name": "...", "slug": "..." } }
GET /api/bot/most-liked?limit={n} Public

Get the most liked models.

Query Parameters

ParameterTypeRequiredDescription
limit integer optional Number of results (default 10)

Example Request

curl "https://krenla.com/api/bot/most-liked?limit=5"

Response

200 OK
{ "models": [ { "name": "...", "likes": 500 } ] }
GET /api/bot/most-views?limit={n} Public

Get the most viewed models.

Query Parameters

ParameterTypeRequiredDescription
limit integer optional Number of results (default 10)

Example Request

curl "https://krenla.com/api/bot/most-views?limit=5"

Response

200 OK
{ "models": [ { "name": "...", "views": 5000 } ] }
GET /api/bot/search?q={query} Public

Search models by name, brand, or type.

Query Parameters

ParameterTypeRequiredDescription
q string required Search query

Example Request

curl "https://krenla.com/api/bot/search?q=sophie"

Response

200 OK
{ "results": [ { "name": "...", "slug": "..." } ], "total": 3 }
GET /api/bot/user-stats?username={u} Public

Get stats for a specific user.

Query Parameters

ParameterTypeRequiredDescription
username string required Username to look up

Example Request

curl "https://krenla.com/api/bot/user-stats?username=admin"

Response

200 OK
{
  "found": true,
  "user": { "username": "admin", "followers": 50, "following": 10, "piyPosts": 12, "forumPosts": 24 }
}
GET /api/bot/model-details?name={name} Public

Get full model details including specs and description.

Query Parameters

ParameterTypeRequiredDescription
name string required Model name

Example Request

curl "https://krenla.com/api/bot/model-details?name=sophie"

Response

200 OK
{ "found": true, "model": { "name": "...", "specs": "...", "description": "..." } }

Rate Limits

All endpoints are rate limited per API key to ensure fair usage across all users.

1,000
Requests / Day
100
Requests / Minute
10
API Keys / User
100
URLs / Minute

Rate Limit Headers: Every response includes X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers so you can track your usage.

Error Codes

Standard HTTP status codes returned by the API.

StatusNameDescription
400Bad RequestInvalid parameters or missing required fields
401UnauthorizedMissing or invalid API key
403ForbiddenValid key but insufficient permissions
404Not FoundRequested resource does not exist
429Too Many RequestsRate limit exceeded
500Internal Server ErrorSomething went wrong on our side

Error format: All errors return JSON with success: false, an error field, and a human-readable message.

Authentication Guide

All protected endpoints require an API key. Here's how to get and use one.

Step 1 — Get an API Key

Call POST /api/v1/auth with your Krenla username and password. You'll receive an API key starting with krenla_.

Step 2 — Include the Key

Pass the API key in every request via the X-API-Key header:

X-API-Key: krenla_AbCdEfGhIjKlMnOpQrStUvWxYz123456

Step 3 — Store it Safely

Never commit API keys to git or expose them client-side. Store them in environment variables or a secrets manager.

Need help with the API?

We're happy to help you integrate.

Contact Support Manage API Keys