URL Shortener -- Documentation & API

Purpose

The URL Shortener creates compact, shareable short links from long web addresses. It solves the problem of unwieldy URLs -- especially in email, social media, and printed materials.

Features
  • Shorten links instantly -- no accounts or registration.
  • Custom aliases -- choose your own short name for links.
  • Password protection -- restrict access to authorized users.
  • QR codes -- generated automatically for every short link.
  • Link preview -- add + to the end of a link to see the destination.
  • Batch shortening -- shorten up to 10 links at once.
Usage

Paste your long URL into the field, click Shorten, and get a compact, shareable link.

API for creating short links

The URL Shortener offers an open API for creating short links programmatically. No authentication required.

Endpoint
POST https://mackan.eu/tools/kortlank/api/shorten.php
Parameters
url (required) -- The long URL to shorten
custom_alias (optional) -- Custom short code (if available)
description (optional) -- Link description
password (optional) -- Password-protected link
lang (optional) -- Language for error messages (sv/en)
Rate limiting

To prevent abuse, each IP address can create a maximum of 200 short links per day. If the limit is exceeded, status code 429 is returned.

Example request
curl -X POST \
  -d "url=https://www.example.com" \
  -d "custom_alias=my-link" \
  https://mackan.eu/tools/kortlank/api/shorten.php
Example response
{
  "shortlink": "https://mackan.eu/m/my-link",
  "id": "my-link",
  "custom_alias": "my-link",
  "description": null
}
Get statistics

Retrieve click statistics for a short link.

GET https://mackan.eu/tools/kortlank/api/stats.php?id={id}
{
  "hits": 42,
  "created_at": "2026-02-17",
  "last_hit": "2026-02-17 14:30"
}
Mackan.eu -- Documentation updated 2026-02-17