Getting Started

Introduction

Build URL shortening and analytics directly into your applications. Create short links, track engagement, and access detailed click data through a fast and reliable API.

Designed around REST principles, the lnqo API features predictable endpoints, JSON responses, bearer token authentication, and standard HTTP response codes for a seamless integration experience.

Base API URL

https://linky-cec9gkdfccftaxb8.uaenorth-01.azurewebsites.net

All requests must be made over HTTPS. HTTP requests will be automatically redirected to secure connections.

Security

Authentication

Dashboard (Cookie)

Browser-based authentication

When you sign in with Google, the API sets an httpOnly jwt cookie.

The lnqo dashboard sends this automatically with credentials: "include".

fetch example
fetch("https://linky-cec9gkdfccftaxb8.uaenorth-01.azurewebsites.net/api/v1/auth/me", {
  credentials: "include"
})

Pro API (Bearer)

Server-side authentication

Server-side integrations use an API key in the Authorization header.

Create keys from the dashboard API keys page (Pro plan only).

HTTP Headers
Authorization: Bearer YOUR_API_KEY
                    Content-Type: application/json

Plan limits

FeatureFreePro
Short links100Unlimited
Click history30 days365 days
City analytics—Included
REST API (Bearer)—Included

Exceeding link limits returns HTTP 403 with a message like Link limit reached (100). Upgrade to Pro for unlimited links. Pro-only features return 403 when called on a Free plan.

Important Security Notice

Keep your API keys completely private. Do not commit keys to public repositories or expose them in client-side applications (like single-page React codebases running on public web browsers).

GET/api/v1/urlAuth

List Short URLs

Returns all short links owned by the authenticated user. Dashboard (browser): send requests with credentials so the httpOnly JWT cookie is included. Pro API: use Authorization: Bearer <API_KEY> from API keys created in the dashboard.

Example

GET Request
const response = await fetch("https://linky-cec9gkdfccftaxb8.uaenorth-01.azurewebsites.net/api/v1/url",
  {
    headers: {
      "Authorization": "Bearer YOUR_API_KEY"
    }
  }
);

const data = await response.json();
console.log(data);

Response

JSON Response
{
  "status": "success",
  "data": [
    {
      "_id": "65a1b2c3d4e5f6789012345",
      "shortCode": "abc123",
      "originalUrl": "https://example.com/page",
      "clicks": 42,
      "createdAt": "2024-01-10T08:00:00.000Z",
      "updatedAt": "2024-01-15T09:00:00.000Z"
    }
  ]
}

HTTP Headers

Header NameTypeRequired
Authorization
Pro API: Bearer token from an API key. Format: Bearer <API_KEY>. Dashboard requests use the session cookie instead.
stringyes

Response Details

200 OK with status success and data as an array of URL documents (shortCode, originalUrl, clicks, timestamps).

DELETE/api/v1/url/:shortCodeAuth

Delete Short URL

Permanently deletes a short link and its click records. Dashboard (browser): send requests with credentials so the httpOnly JWT cookie is included. Pro API: use Authorization: Bearer <API_KEY> from API keys created in the dashboard.

Example

DELETE Request
const response = await fetch("https://linky-cec9gkdfccftaxb8.uaenorth-01.azurewebsites.net/api/v1/url/:shortCode",
  {
    method: "DELETE",
    headers: {
      "Authorization": "Bearer YOUR_API_KEY"
    }
  }
);

// 204 No Content on success

Response

Response
HTTP 204 No Content (no JSON body)

HTTP Headers

Header NameTypeRequired
Authorization
Pro API: Bearer token from an API key. Format: Bearer <API_KEY>. Dashboard requests use the session cookie instead.
stringyes

Query Parameters

ParameterTypeRequired
shortCode
Short code of the link to delete.
stringyes

Response Details

204 No Content on success. 404 if the link is not found.

GET/api/v1/analytics/overviewAuth

Analytics Overview

Aggregated KPIs, click timeline, top links, and breakdowns for all owned links. Dashboard (browser): send requests with credentials so the httpOnly JWT cookie is included. Pro API: use Authorization: Bearer <API_KEY> from API keys created in the dashboard. Free plan click history is limited to 30 days — responses may include clamped: true when a longer period was requested.

Example

GET Request
const response = await fetch("https://linky-cec9gkdfccftaxb8.uaenorth-01.azurewebsites.net/api/v1/analytics/overview",
  {
    headers: {
      "Authorization": "Bearer YOUR_API_KEY"
    }
  }
);

const data = await response.json();
console.log(data);

Response

JSON Response
{
  "status": "success",
  "data": {
    "period": "30d",
    "clamped": true,
    "summary": {
      "totalUrls": 12,
      "totalClicks": 1250,
      "clicksInPeriod": 340,
      "clicksToday": 18,
      "clicksLast7d": 120,
      "clicksLast30d": 340,
      "activeLinksInPeriod": 8
    },
    "timeline": [
      { "date": "2024-01-14", "clicks": 12 },
      { "date": "2024-01-15", "clicks": 18 }
    ],
    "topLinks": [
      {
        "shortCode": "abc123",
        "originalUrl": "https://example.com/page",
        "clicks": 120,
        "totalClicks": 342,
        "createdAt": "2024-01-10T08:00:00.000Z"
      }
    ],
    "breakdowns": {
      "deviceTypes": [{ "name": "mobile", "count": 200 }],
      "browsers": [{ "name": "Chrome", "count": 150 }],
      "referrers": [{ "name": "direct", "count": 90 }],
      "regions": [{ "name": "US", "count": 120 }]
    }
  }
}

HTTP Headers

Header NameTypeRequired
Authorization
Pro API: Bearer token from an API key. Format: Bearer <API_KEY>. Dashboard requests use the session cookie instead.
stringyes

Query Parameters

ParameterTypeRequired
period
Time range: 24h, 7d, or 30d. Default: 30d
stringno
limit
Max top links to return. Default: 5, max: 50
integerno

Response Details

200 OK with period, optional clamped flag, summary KPIs, timeline, topLinks, and breakdowns.

GET/api/v1/analytics/recent-clicksAuth

Recent Clicks Feed

Latest click events with device and region metadata. Dashboard (browser): send requests with credentials so the httpOnly JWT cookie is included. Pro API: use Authorization: Bearer <API_KEY> from API keys created in the dashboard. History window depends on plan (30d free, 365d pro).

Example

GET Request
const response = await fetch("https://linky-cec9gkdfccftaxb8.uaenorth-01.azurewebsites.net/api/v1/analytics/recent-clicks",
  {
    headers: {
      "Authorization": "Bearer YOUR_API_KEY"
    }
  }
);

const data = await response.json();
console.log(data);

Response

JSON Response
{
  "status": "success",
  "results": 2,
  "data": [
    {
      "shortCode": "abc123",
      "deviceType": "mobile",
      "browser": "Chrome",
      "region": "US",
      "referrer": "https://google.com",
      "clickedAt": "2024-01-15T10:30:00.000Z"
    },
    {
      "shortCode": "def456",
      "deviceType": "desktop",
      "browser": "Firefox",
      "region": "UK",
      "referrer": "direct",
      "clickedAt": "2024-01-15T10:29:00.000Z"
    }
  ]
}

HTTP Headers

Header NameTypeRequired
Authorization
Pro API: Bearer token from an API key. Format: Bearer <API_KEY>. Dashboard requests use the session cookie instead.
stringyes

Query Parameters

ParameterTypeRequired
limit
Max events. Default: 20, max: 100
integerno
shortCode
Filter to a single short code.
stringno

Response Details

200 OK with results count and data array of click documents.