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
Request Body
{
"url": "https://example.com/long-url"
}url(string, required): The destination URL you want to shorten.
Additional Parameters
expiryOptionalSet an expiration time for the link. Defaults to "1 week".
lengthOptionalDefine the type/length of the short code. Defaults to "short".
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"
}'Guides & Control
Short Links
Our standard short links use a 6-character alphanumeric code. They are concise and perfect for social media sharing.
Safe Links
"Safe" links generate a 12-character code. This increased entropy makes them significantly harder to guess or brute-force, providing "security through obscurity".
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.