Developer Resources

Integrate Lnk.ad directly into your applications with our simple REST API, or learn more about the platform's features for power users.

Introduction

The Lnk.ad API is designed to be minimal and fast. It allows you to programmatically shorten URLs from your own applications, scripts, or command line tools. Currently, the API is public and does not require authentication for basic usage.

Create Short Link

POST/api/shorten

Request Body

{
  "url": "https://example.com/long-url"
}

url(string, required): The destination URL you want to shorten.

Additional Parameters

expiryOptional

Set an expiration time for the link. Defaults to "1 week".

"1 day""1 week""2 months""6 months""1 year""never"
lengthOptional

Define the type/length of the short code. Defaults to "short".

"short" (5 chars)"safest" (7 chars)

Example Response

{
  "originalUrl": "https://example.com/long-url",
  "shortCode": "abc123",
  "clicks": 0
}

Usage Example (cURL)

curl -X POST https://lnk.ad/api/shorten \
  -H "Content-Type: application/json" \
  -d '{"url":"https://github.com/microsoft"}'

Advanced Usage (Custom Settings)

curl -X POST https://lnk.ad/api/shorten \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://github.com/microsoft",
    "expiry": "never",
    "length": "safest"
  }'

Link Expiry Controls

When using the web interface, you can set an automatic expiration time for your links. Expired links are deleted from our database and can no longer be accessed.

1 HourGood for temporary file sharing or quick checks.
1 DayStandard for daily updates or 24h stories.
1 WeekUseful for event registration or limited-time offers.
NeverPermanent links that stay active indefinitely.