API Reference
List Links
GET /api/v1/links — List your shortened links with click counts.
GET /api/v1/links
Retrieve a paginated list of your links, sorted by most recent. Includes click counts and OG metadata.
Request
curl -H "Authorization: Bearer trak_YOUR_API_KEY" \
"https://trak.sh/api/v1/links?page=1&limit=20&search=github"Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number (1-indexed) |
limit | number | 20 | Results per page (1-100) |
search | string | — | Filter links by slug, destination URL, or title |
Response (200 OK)
{
"links": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"slug": "my-link",
"shortUrl": "https://trak.sh/my-link",
"destinationUrl": "https://example.com/my-long-url",
"title": "Example Page Title",
"tag": "marketing",
"isPublicStats": false,
"clicks": 42,
"createdAt": "2026-04-03T12:00:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 47,
"totalPages": 3
}
}Link object fields
| Field | Type | Description |
|---|---|---|
id | string | UUID of the link |
slug | string | Short slug (e.g., "my-link") |
shortUrl | string | Full short URL (e.g., "https://trak.sh/my-link") |
destinationUrl | string | Where the link redirects to |
title | string or null | OG title fetched from destination page |
tag | string or null | User-assigned tag |
isPublicStats | boolean | Whether the stats page is public |
clicks | number | Total click count |
createdAt | string | ISO 8601 timestamp |