Aller au contenu

Statistics

Views and clicks over the period you choose, for one element, for a tag's elements or for the whole environment, with their breakdown by source, country and device.

Clicks on a short link

GET/v1/links/{id}/stats

?days= is 1, 7, 30 (default), 90, or 0 for all time. Read scope.

  • total — the period total; previous_total the previous period's and change_pct the change in percent
  • all_time_total — the total since creation
  • daily — the daily series; with ?days=0 it is replaced by monthly, one entry per month (month, count)
  • referrers — the source: a domain name, direct or unknown
  • countries — the two-letter country code, or unknown
  • devices — desktop, mobile, tablet, console, tv or unknown
curl "https://api.tinylink.fr/v1/links/promo/stats?days=7" \
  -H "Authorization: Bearer tl_your_token"

Possible responses

{
  "metric": "clicks",
  "days": 7,
  "from": "2026-09-29",
  "to": "2026-10-05",
  "total": 42,
  "previous_total": 35,
  "change_pct": 20.0,
  "all_time_total": 318,
  "daily": [
    {
      "date": "2026-09-29",
      "count": 4
    },
    {
      "date": "2026-09-30",
      "count": 9
    },
    {
      "date": "2026-10-01",
      "count": 6
    },
    {
      "date": "2026-10-02",
      "count": 3
    },
    {
      "date": "2026-10-03",
      "count": 8
    },
    {
      "date": "2026-10-04",
      "count": 7
    },
    {
      "date": "2026-10-05",
      "count": 5
    }
  ],
  "referrers": [
    {
      "source": "instagram.com",
      "count": 25
    },
    {
      "source": "direct",
      "count": 17
    }
  ],
  "countries": [
    {
      "country": "FR",
      "count": 36
    },
    {
      "country": "BE",
      "count": 6
    }
  ],
  "devices": [
    {
      "device": "mobile",
      "count": 31
    },
    {
      "device": "desktop",
      "count": 11
    }
  ]
}

Views of a page

GET/v1/pages/{id}/stats

Same parameters and same fields, with metric set to views. On top comes links: the clicks on each of the page's links over the period. Read scope.

curl "https://api.tinylink.fr/v1/pages/my-page/stats?days=7" \
  -H "Authorization: Bearer tl_your_token"

Possible responses

{
  "metric": "views",
  "days": 7,
  "from": "2026-09-29",
  "to": "2026-10-05",
  "total": 42,
  "previous_total": 35,
  "change_pct": 20.0,
  "all_time_total": 318,
  "daily": [
    {
      "date": "2026-09-29",
      "count": 4
    },
    {
      "date": "2026-09-30",
      "count": 9
    },
    {
      "date": "2026-10-01",
      "count": 6
    },
    {
      "date": "2026-10-02",
      "count": 3
    },
    {
      "date": "2026-10-03",
      "count": 8
    },
    {
      "date": "2026-10-04",
      "count": 7
    },
    {
      "date": "2026-10-05",
      "count": 5
    }
  ],
  "referrers": [
    {
      "source": "instagram.com",
      "count": 25
    },
    {
      "source": "direct",
      "count": 17
    }
  ],
  "countries": [
    {
      "country": "FR",
      "count": 36
    },
    {
      "country": "BE",
      "count": 6
    }
  ],
  "devices": [
    {
      "device": "mobile",
      "count": 31
    },
    {
      "device": "desktop",
      "count": 11
    }
  ],
  "links": [
    {
      "id": "L6ac4011edb7c6",
      "title": "My website",
      "clicks": 19
    },
    {
      "id": "L6ac4011ee9fab",
      "title": "Contact",
      "clicks": 4
    }
  ]
}

Environment statistics

GET/v1/stats

The figures for the token's whole environment, as on the dashboard. ?days= is 1, 7, 30 (default), 90, or 0 for all time; ?limit= (1 to 100, default 10) sets the length of the rankings. Read scope.

  • page_views — page views; page_link_clicks — clicks on the links of those pages; short_link_clicks — short link clicks. Each one has total, previous_total, change_pct and all_time_total, as in an element's statistics
  • click_through_rate — the share of page views followed by a click, in percent (value), and the previous period's (previous_value); null without views
  • daily — one entry per day with the three counters; with ?days=0 it is replaced by monthly, one entry per month
  • referrers, countries, devices — the source, country and device of page views and short link clicks, in the same format as for an element
  • top_pages — the most viewed pages over the period, with their views and the clicks on their links; top_links — the most clicked short links
curl "https://api.tinylink.fr/v1/stats?days=7&limit=1" \
  -H "Authorization: Bearer tl_your_token"

Possible responses

{
  "days": 7,
  "from": "2026-09-29",
  "to": "2026-10-05",
  "page_views": {
    "total": 104,
    "previous_total": 88,
    "change_pct": 18.2,
    "all_time_total": 1240
  },
  "page_link_clicks": {
    "total": 42,
    "previous_total": 40,
    "change_pct": 5.0,
    "all_time_total": 517
  },
  "short_link_clicks": {
    "total": 50,
    "previous_total": 62,
    "change_pct": -19.4,
    "all_time_total": 688
  },
  "click_through_rate": {
    "value": 40.4,
    "previous_value": 45.5
  },
  "daily": [
    {
      "date": "2026-09-29",
      "page_views": 12,
      "page_link_clicks": 5,
      "short_link_clicks": 8
    },
    {
      "date": "2026-09-30",
      "page_views": 18,
      "page_link_clicks": 7,
      "short_link_clicks": 6
    },
    {
      "date": "2026-10-01",
      "page_views": 9,
      "page_link_clicks": 3,
      "short_link_clicks": 11
    },
    {
      "date": "2026-10-02",
      "page_views": 15,
      "page_link_clicks": 6,
      "short_link_clicks": 4
    },
    {
      "date": "2026-10-03",
      "page_views": 22,
      "page_link_clicks": 9,
      "short_link_clicks": 7
    },
    {
      "date": "2026-10-04",
      "page_views": 17,
      "page_link_clicks": 8,
      "short_link_clicks": 9
    },
    {
      "date": "2026-10-05",
      "page_views": 11,
      "page_link_clicks": 4,
      "short_link_clicks": 5
    }
  ],
  "referrers": [
    {
      "source": "instagram.com",
      "count": 71
    },
    {
      "source": "direct",
      "count": 58
    },
    {
      "source": "t.co",
      "count": 17
    },
    {
      "source": "QR Code",
      "count": 8
    }
  ],
  "countries": [
    {
      "country": "FR",
      "count": 118
    },
    {
      "country": "BE",
      "count": 21
    },
    {
      "country": "CA",
      "count": 9
    },
    {
      "country": "unknown",
      "count": 6
    }
  ],
  "devices": [
    {
      "device": "mobile",
      "count": 109
    },
    {
      "device": "desktop",
      "count": 41
    },
    {
      "device": "tablet",
      "count": 4
    }
  ],
  "top_pages": [
    {
      "id": "P6ac4011ea1b2c",
      "name": "My page",
      "url": "https://tnylnk.fr/my-page",
      "views": 104,
      "link_clicks": 42
    }
  ],
  "top_links": [
    {
      "id": "6ac401093831b",
      "url": "https://tnlnk.fr/promo",
      "target_url": "https://example.com/promo",
      "clicks": 50
    }
  ]
}

Tag statistics

GET/v1/tags/{id}/stats

The same figures, limited to the pages and short links that carry the tag, with the same parameters. On top comes tag, the tag itself. With ?limit=100, top_pages and top_links give the figures of each of the tag's elements (at most 100 of each type). Read scope.

curl "https://api.tinylink.fr/v1/tags/46/stats?days=7&limit=1" \
  -H "Authorization: Bearer tl_your_token"

Possible responses

{
  "tag": {
    "id": 46,
    "name": "Campaign",
    "color": "#1E90FF",
    "elements_count": 2,
    "created_at": "2026-10-05T21:56:57+02:00"
  },
  "days": 7,
  "from": "2026-09-29",
  "to": "2026-10-05",
  "page_views": {
    "total": 104,
    "previous_total": 88,
    "change_pct": 18.2,
    "all_time_total": 1240
  },
  "page_link_clicks": {
    "total": 42,
    "previous_total": 40,
    "change_pct": 5.0,
    "all_time_total": 517
  },
  "short_link_clicks": {
    "total": 50,
    "previous_total": 62,
    "change_pct": -19.4,
    "all_time_total": 688
  },
  "click_through_rate": {
    "value": 40.4,
    "previous_value": 45.5
  },
  "daily": [
    {
      "date": "2026-09-29",
      "page_views": 12,
      "page_link_clicks": 5,
      "short_link_clicks": 8
    },
    {
      "date": "2026-09-30",
      "page_views": 18,
      "page_link_clicks": 7,
      "short_link_clicks": 6
    },
    {
      "date": "2026-10-01",
      "page_views": 9,
      "page_link_clicks": 3,
      "short_link_clicks": 11
    },
    {
      "date": "2026-10-02",
      "page_views": 15,
      "page_link_clicks": 6,
      "short_link_clicks": 4
    },
    {
      "date": "2026-10-03",
      "page_views": 22,
      "page_link_clicks": 9,
      "short_link_clicks": 7
    },
    {
      "date": "2026-10-04",
      "page_views": 17,
      "page_link_clicks": 8,
      "short_link_clicks": 9
    },
    {
      "date": "2026-10-05",
      "page_views": 11,
      "page_link_clicks": 4,
      "short_link_clicks": 5
    }
  ],
  "referrers": [
    {
      "source": "instagram.com",
      "count": 71
    },
    {
      "source": "direct",
      "count": 58
    },
    {
      "source": "t.co",
      "count": 17
    },
    {
      "source": "QR Code",
      "count": 8
    }
  ],
  "countries": [
    {
      "country": "FR",
      "count": 118
    },
    {
      "country": "BE",
      "count": 21
    },
    {
      "country": "CA",
      "count": 9
    },
    {
      "country": "unknown",
      "count": 6
    }
  ],
  "devices": [
    {
      "device": "mobile",
      "count": 109
    },
    {
      "device": "desktop",
      "count": 41
    },
    {
      "device": "tablet",
      "count": 4
    }
  ],
  "top_pages": [
    {
      "id": "P6ac4011ea1b2c",
      "name": "My page",
      "url": "https://tnylnk.fr/my-page",
      "views": 104,
      "link_clicks": 42
    }
  ],
  "top_links": [
    {
      "id": "6ac401093831b",
      "url": "https://tnlnk.fr/promo",
      "target_url": "https://example.com/promo",
      "clicks": 50
    }
  ]
}

Still stuck?

Write to us from the Support tab of your workspace, we answer within one business day.

Contact support