Usage and limits
See how much of its plan a client has used, and what its key may do.
Request#
curl https://api.yourbrand.com/api/usage -H 'Authorization: Bearer nl_live_…' Answer#
A plain object, without data:
{ "links": 3, "link_limit": 1000, "clicks_this_month": 0, "click_limit": 100000, "month_start": 1793491200, "resets_at": 1796083200, "key_scope": "read_write", "rate_limit": 0 } | Field | Meaning |
|---|---|
links, link_limit | Links the client has, and its limit |
clicks_this_month, click_limit | Clicks from people since month_start, and the monthly limit |
month_start, resets_at | When the month began and when it resets (Unix seconds, UTC) |
key_scope | read_write or read_only |
rate_limit | Requests a minute for this key; 0 means none |
-1 means no limit.
Show it to people#
const u = await fetch(`${BASE}/api/usage`, { headers }).then(r => r.json());
const pct = u.link_limit > 0 ? Math.round(100 * u.links / u.link_limit) : 0;
console.log(`${u.links} of ${u.link_limit < 0 ? 'unlimited' : u.link_limit} links (${pct}%)`); Numbers can lag by up to a minute. See Rate limits and usage.


