trak.sh docs
API Reference

List Links

GET /api/v1/links — List your shortened links with click counts.

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

ParameterTypeDefaultDescription
pagenumber1Page number (1-indexed)
limitnumber20Results per page (1-100)
searchstringFilter 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
  }
}
FieldTypeDescription
idstringUUID of the link
slugstringShort slug (e.g., "my-link")
shortUrlstringFull short URL (e.g., "https://trak.sh/my-link")
destinationUrlstringWhere the link redirects to
titlestring or nullOG title fetched from destination page
tagstring or nullUser-assigned tag
isPublicStatsbooleanWhether the stats page is public
clicksnumberTotal click count
createdAtstringISO 8601 timestamp

On this page