Quickstart

1. Create an API key

In API keys pick the lnk product, a name, the scopes you need and an expiry. The secret is shown only once: store it in an environment variable or a secrets manager.

export LNK_API_KEY="lk_lnk_..."

2. Check the key

curl -s https://lnk.ec/api/v1/whoami -H "Authorization: Bearer $LNK_API_KEY"
{
  "product": "lnk",
  "key": { "scopes": ["links:read", "links:write"], "expiresAt": "2027-03-01T00:00:00.000Z" },
  "account": { "tier": "free" },
  "limits": { "rpm": 30, "burst": 10, "dailyQuota": 1000 }
}
curl -s -X POST https://lnk.ec/api/v1/links \
  -H "Authorization: Bearer $LNK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/my-long-page", "title": "My page"}'
const res = await fetch("https://lnk.ec/api/v1/links", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.LNK_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ url: "https://example.com/my-long-page", title: "My page" }),
});
const link = await res.json();
console.log(link.url);
import os, requests

r = requests.post(
    "https://lnk.ec/api/v1/links",
    headers={"Authorization": f"Bearer {os.environ['LNK_API_KEY']}"},
    json={"url": "https://example.com/my-long-page", "title": "My page"},
    timeout=10,
)
r.raise_for_status()
print(r.json()["url"])

201 response:

{
  "id": "65f0c0ffee0123456789abcd",
  "shortCode": "aB3dE9",
  "url": "https://lnk.ec/aB3dE9",
  "longUrl": "https://example.com/my-long-page",
  "title": "My page",
  "status": "active",
  "accessLevel": "private",
  "clicks": 0,
  "createdAt": "2026-12-01T12:00:00.000Z"
}
The first time, the account must accept the lnk.ec content policy from the dashboard; otherwise you get content_policy_required.

4. Read analytics

curl -s "https://lnk.ec/api/v1/links/ID/analytics?groupBy=country" -H "Authorization: Bearer $LNK_API_KEY"

Next steps

  • Respect the limits and retry with exponential backoff on 429.
  • Read the errors page and handle them by error.code.
  • Connect an AI agent with the MCP guide.