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

Link statistics

Range totals, a daily or hourly series and breakdowns by country, device, OS, browser or source.

Scope and limits

Scope

API key with the urlshortener service enabled

Usage limit

120 requests per minute

  • Windows of up to 366 days by day, and up to 31 days by hour.
  • Up to 100 values per dimension.
  • On top of that, each query spends units from a quota of 120 per minute for your organization, according to its cost: 2 for the query and 3 for every 31 days of the range. 30 days spend 5; a year, 38. Without units, 429 with Retry-After.

Analytics for one link over a window of days: the range totals, a daily or hourly series and the values with the most visits for each dimension. Days and hours are Colombia’s (America/Bogota).

  • totals.clicks and totals.uniqueClicks are the range’s; firstClickAt and lastClickAt, the link’s lifetime.
  • The series is sparse: days or hours without visits are omitted. Fill them with zero if you are going to chart it.
  • Each dimension returns the top values with the most visits and, if there is a remainder, an __other row. A visit with no value for a dimension (no country, or no source) does not appear in it: its rows can add up to less than the total.
  • referrer is only the source domain (www.facebook.com), without the path. Direct visits have no row: they are totals.clicks minus the sum of referrer.
  • device is mobile, tablet or desktop; os, Android, iOS, Windows, macOS, Linux, ChromeOS or Other; browser, Chrome, Safari, Firefox, Edge, Opera, Samsung Internet, UC Browser or Other. country is the ISO code (CO).

uniqueClicks counts the first visit of the day from each browser. Over a multi-day range it is the sum of each day, not distinct people. Responses can be up to one minute old (X-Cache header).

Path parameters

domain
stringrequired
Domain of the link, as the API returns it in domain. Compared in lowercase. It names the link that answers at that short URL today; for one on a domain that no longer belongs to your organization (domainStatus: released), add domainStatus=released.
code
stringrequired
Code or alias of the link. Compared in lowercase.

Query parameters

domainStatus
stringoptional
With released, the link is the one on a domain that no longer belongs to your organization (the one the list returns with domainStatus: released), even if that name is today another domain with the same code. Without it, domain names the domain that has that name today. Any other value returns 400 VALIDATION_INVALID_PARAMETER.
released
from
stringoptional
First day of the window, YYYY-MM-DD in Colombia time, inclusive. Defaults to 29 days before to (a 30-day window).
to
stringoptional
Last day of the window, YYYY-MM-DD in Colombia time, inclusive. Defaults to today.
granularity
stringoptional
Size of each point of the series. day allows windows of up to 366 days; hour, up to 31.
dayhour

Default: day

dimensions
stringoptional
Comma-separated breakdown dimensions: country, subdivision, city, device, os, browser, referrer. Defaults to country,device,os,browser,referrer. Unknown names are ignored.
top
integeroptional
How many values each dimension (and each ranking) returns. Max 100.

Default: 10

Responses

200

Link analytics.

{
  "success": true,
  "data": {
    "domain": "h0b.co",
    "code": "a1b2c3d",
    "shortUrl": "https://h0b.co/a1b2c3d",
    "range": { "from": "2026-08-25", "to": "2026-09-23", "granularity": "day", "timezone": "America/Bogota" },
    "totals": {
      "clicks": 128,
      "uniqueClicks": 96,
      "firstClickAt": "2026-09-20T15:31:40Z",
      "lastClickAt": "2026-09-23T18:22:10Z"
    },
    "series": [
      { "at": "2026-09-20", "clicks": 40, "uniqueClicks": 31 },
      { "at": "2026-09-23", "clicks": 88, "uniqueClicks": 65 }
    ],
    "dimensions": {
      "country": [{ "value": "CO", "clicks": 110 }, { "value": "__other", "clicks": 12 }],
      "device": [{ "value": "mobile", "clicks": 101 }, { "value": "desktop", "clicks": 27 }]
    }
  },
  "meta": {
    "requestId": "8f0c0e2a4b1d4c8fae2b7a91e0c5d3f6",
    "timestamp": "2026-09-23T18:30:00+00:00",
    "responseTimeMs": 7.2
  }
}
400

A date that is not YYYY-MM-DD, from after to, a window above the limit or an unknown granularity.

401

Invalid or missing credentials.

403

The API key does not have the URL shortener enabled (or it is turned off for your organization), the key cannot be used from the request network, or the organization is not active.

404

No link of your organization with that domain and code (or it was deleted). A link from another organization also returns 404: its existence is not disclosed.

429

Request limit exceeded.

504

The query took too long and we stopped it. It happens with very large queries for organizations with many links: narrow it (fewer days, fewer sections, more filters). Repeating it as is does not help.

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/h0b.co/a1b2c3d/stats?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, as the API returns it in domain. Compared in lowercase. It names the link that answers at that short URL today; for one on a domain that no longer belongs to your organization (domainStatus: released), add domainStatus=released.

Code or alias of the link. Compared in lowercase.

With released, the link is the one on a domain that no longer belongs to your organization (the one the list returns with domainStatus: released), even if that name is today another domain with the same code. Without it, domain names the domain that has that name today. Any other value returns 400 VALIDATION_INVALID_PARAMETER.

First day of the window, YYYY-MM-DD in Colombia time, inclusive. Defaults to 29 days before to (a 30-day window).

Last day of the window, YYYY-MM-DD in Colombia time, inclusive. Defaults to today.

Size of each point of the series. day allows windows of up to 366 days; hour, up to 31.

Comma-separated breakdown dimensions: country, subdivision, city, device, os, browser, referrer. Defaults to country,device,os,browser,referrer. Unknown names are ignored.

How many values each dimension (and each ranking) returns. Max 100.

GET https://developers.hablame.co/api/v6/urlshortener/links/h0b.co/a1b2c3d/stats?dimensions=country%2Cdevice

Response

You have not sent a request yet.