GET/api/v6/urlshortener/links/{domain}/{code}/stats

Link statistics

Totals, time series and breakdowns by country, device or referrer.

Scope and limits

Scope

API key with the urlshortener service enabled

Usage limit

120 requests per minute

  • Hourly granularity is only available for ranges of 31 days or less, within the last 90 days.

Click analytics for one link: totals, a time series and top-N breakdowns by dimension. Day and hour buckets are computed in America/Bogota.

uniqueClicks summed over a multi-day range is an approximation: uniques are deduplicated per day.

Path parameters

domain
stringrequired
Domain of the link.
code
stringrequired
Short code or alias (lowercase).

Query parameters

range
stringoptional
Preset window. Ignored when you send from or to.
last_24hlast_7dlast_30dlast_90dthis_monthlast_monthytdall_time

Default: last_30d

from
stringoptional
Start of a custom window (ISO-8601).
to
stringoptional
End of the custom window (ISO-8601). Defaults to now.
granularity
stringoptional
Automatic when omitted.
hourday
dimensions
stringoptional
Comma-separated breakdown dimensions: country, subdivision, city, device, os, browser, referrer.

Responses

200

Link analytics.

{
  "success": true,
  "data": {
    "code": "a1b2c3d",
    "domain": "go.acme.co",
    "range": {
      "from": "2026-05-03T00:00:00-05:00",
      "to": "2026-06-01T18:30:00-05:00",
      "granularity": "day"
    },
    "totals": {
      "clicks": 128,
      "uniqueClicks": 96,
      "firstClickAt": "2026-05-04T12:00:00Z",
      "lastClickAt": "2026-06-01T18:22:10Z"
    },
    "series": [{ "ts": "2026-05-04", "clicks": 40, "uniqueClicks": 31 }],
    "breakdowns": {
      "country": [{ "key": "CO", "clicks": 90 }, { "key": "__other", "clicks": 38 }],
      "device": [{ "key": "mobile", "clicks": 110 }]
    }
  },
  "meta": {
    "requestId": "8f0c0e2a4b1d4c8fae2b7a91e0c5d3f6",
    "timestamp": "2026-06-01T18:30:00+00:00",
    "responseTimeMs": 9.4
  }
}
400

Invalid range or granularity.

401

Invalid or missing credentials.

404

No link with that domain and code.

429

Request limit exceeded.

Possible errors

Codes this endpoint can return in error.code. The full detail lives in the catalog.

See the full catalog
GET /api/v6/urlshortener/links/{domain}/{code}/stats
curl -X GET 'https://developers.hablame.co/api/v6/urlshortener/links/go.acme.co/a1b2c3d/stats?range=last_30d&dimensions=country%2Cdevice' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer hk_YOUR_API_KEY'

Try-It

Run the request against the real API with your own API key.

The key is used only in your browser for this request. It is not stored nor sent anywhere else.

Parameters

Domain of the link.

Short code or alias (lowercase).

Preset window. Ignored when you send from or to.

Start of a custom window (ISO-8601).

End of the custom window (ISO-8601). Defaults to now.

Automatic when omitted.

Comma-separated breakdown dimensions: country, subdivision, city, device, os, browser, referrer.

GET https://developers.hablame.co/api/v6/urlshortener/links/go.acme.co/a1b2c3d/stats?range=last_30d&dimensions=country%2Cdevice

Response

You have not sent a request yet.