API Reference
CSV Export
Download raw click data for a link as a CSV file.
CSV Export
Export raw click data for any of your links as a downloadable CSV file. This feature is available from both the dashboard and the API.
From the dashboard
- Open any link's analytics page
- Click the Export CSV button in the header (Pro users only)
- The CSV file downloads automatically
Via API
curl -H "Authorization: Bearer trak_YOUR_API_KEY" \
-o clicks.csv \
"https://trak.sh/api/links/LINK_UUID/export"Note: The export endpoint uses the link's UUID (not the slug). You can find the UUID in the list links response.
CSV columns
| Column | Description | Example |
|---|---|---|
timestamp | ISO 8601 click timestamp | 2026-04-03T12:34:56.789Z |
referrer | Source URL or "Direct" | https://twitter.com |
country | ISO 3166-1 alpha-2 code | US |
city | City name | San Francisco |
device_type | Device category | desktop, mobile, tablet |
browser | Browser name | Chrome |
os | Operating system | macOS |
Example output
timestamp,referrer,country,city,device_type,browser,os
2026-04-03T12:34:56.789Z,https://twitter.com,US,San Francisco,desktop,Chrome,macOS
2026-04-03T12:35:12.456Z,Direct,BD,Dhaka,mobile,Safari,iOS
2026-04-03T12:36:01.123Z,https://news.ycombinator.com,GB,London,desktop,Firefox,WindowsNotes
- Export includes all click data for the link (no time range filter)
- Pro plan required
- Null referrers are exported as "Direct"
- Null cities are exported as empty strings
- Values containing commas are properly quoted