🚀 Getting Started

The TinyLink API allows you to programmatically create and manage shortened URLs. All API endpoints are accessible via HTTPS and return JSON responses.

Base URL: https://tlnk.ink/api/

🔐 Authentication

API authentication is required for Business and Enterprise plans. Include your API key in the request headers:

Authorization: Bearer YOUR_API_KEY

📎 Shorten URL

POST /api/shorten

Create a new shortened URL.

Request Parameters

Parameter Type Required Description
long_url string Yes The URL to shorten
custom_code string No Custom short code (Business+ only)

Example Request

curl -X POST https://tlnk.ink/api/shorten \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"long_url": "https://example.com/very-long-url"}'

Example Response

{
  "success": true,
  "short_url": "https://tlnk.ink/abc12345",
  "long_url": "https://example.com/very-long-url",
  "short_code": "abc12345",
  "created_at": "2025-01-14T16:30:00Z"
}

📊 Get URL Statistics

GET /api/stats/{short_code}

Retrieve statistics for a shortened URL.

Example Request

curl -X GET https://tlnk.ink/api/stats/abc12345 \
  -H "Authorization: Bearer YOUR_API_KEY"

Example Response

{
  "success": true,
  "short_code": "abc12345",
  "long_url": "https://example.com/very-long-url",
  "clicks": 42,
  "created_at": "2025-01-14T16:30:00Z"
}

⚡ Rate Limits

Plan Rate Limit
Free 10 requests/minute
Standard 100 requests/minute
Business 1,000 requests/minute
Enterprise Custom

❌ Error Codes

Code Description
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid or missing API key
403 Forbidden - Quota exceeded
404 Not Found - Short code does not exist
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error