trak.sh docs
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

  1. Open any link's analytics page
  2. Click the Export CSV button in the header (Pro users only)
  3. 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

ColumnDescriptionExample
timestampISO 8601 click timestamp2026-04-03T12:34:56.789Z
referrerSource URL or "Direct"https://twitter.com
countryISO 3166-1 alpha-2 codeUS
cityCity nameSan Francisco
device_typeDevice categorydesktop, mobile, tablet
browserBrowser nameChrome
osOperating systemmacOS

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,Windows

Notes

  • 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

On this page