ForHosting KIT · Developer Utilities

Track link clicks

A short link that nobody measures is just a redirect. This API pulls the click history for a given short URL — counts, referrers, rough geography, device breakdown — and hands it back as structured data you can pipe straight into a dashboard, report or attribution model, without scraping an analytics UI.

● StablePer request + per link$0.002
Use it from WebAPIEmailApp soonTelegram soon

Run this on our servers with your account. Free tools run in your browser; this one bills your KIT balance per the price above.

The question this answers

Once a short link is live, the obvious next question is simple: did it work? Who clicked, from where, on what, and when. Answering that by eyeballing a web dashboard doesn't scale past a handful of links, and most dashboards weren't built to be queried programmatically in the first place. dev.short_url_stats exists to turn that question into an API call: give it a short link, get back the numbers behind it.

What the response actually contains

You submit the short link (or its identifier) you want data for, and the task returns click counts over the available window, referrer sources where known, a device and browser breakdown, and coarse geographic distribution — the kind of signal that's useful for attribution without being invasive. As with every endpoint here, the call is async: you get a task_id immediately, and the compiled statistics arrive by signed webhook or a 24-hour signed link once ready.

Who actually needs click-level detail

Growth and marketing teams comparing channel performance across campaigns that share the same offer but different short links. Product teams validating that an in-app referral link is actually being used before investing more in the referral feature. Support and fraud teams spot-checking whether a link that's driving unusual traffic is being abused. Anyone running a link-in-bio or affiliate setup who needs per-link performance without logging into a separate dashboard for every one.

Why referrer and geography data is inherently approximate

It's worth being upfront about a general truth of click analytics: referrer headers are sometimes withheld by browsers or apps for privacy reasons, and geography is inferred from network origin rather than GPS, so it's a reasonable approximation rather than a precise location. This isn't a limitation specific to our API — it's how HTTP works — but it shapes what the numbers can honestly tell you.

Fitting it into a reporting pipeline

Because results come back as structured data via webhook, you can schedule a stats pull after a campaign ends, or query it on demand when someone asks 'how's that link doing?' Pair it with dev.short_url so link creation and link performance live in the same workflow instead of two disconnected tools.

Campaign comparison

Pull click counts for every short link in a multi-channel campaign to see which channel actually drove traffic, not just which one got the most impressions.

Referral program validation

Check whether referral links generated inside your app are being clicked at all before deciding whether to expand the referral feature.

Anomaly spot-checks

Query the geography and device breakdown for a link showing an unusual traffic spike to judge whether it looks organic or automated.

Affiliate and link-in-bio reporting

Generate a per-link performance summary for creators or partners without giving them dashboard access to your full account.

What data does the click analytics API return?

Click counts, known referrer sources, device and browser breakdown, and coarse geographic distribution for a given short link.

Does it track individual users?

No — the data returned is aggregated (counts and breakdowns), not a personal log tied to identifiable visitors.

Is link click tracking accurate down to the exact city?

Geography is inferred from network origin, so it's a reasonable approximation, typically reliable at the country or region level rather than pinpoint-accurate.

Can I get stats for any short link, or only ones I created?

Only for short links created under your account — you can't query analytics for links you don't own.

Is there a free way to test this?

There's no free tier — free tiers get abused and slow everyone down. Access runs on a prepaid ForHosting KIT balance: top up from $10.00 (it never expires) and each request is charged at its published price, so a call with no balance returns HTTP 402. No subscription, no tokens, no invented credits, and a failed task is never charged.

How do I receive the statistics?

Via signed webhook (recommended) or a signed link valid for 24 hours, matching the delivery pattern of every task in the platform.

What's the cost per stats request?

0.002 dollars per request, and you're never charged for a request that fails after retries.

Can I pull stats for many links in bulk?

Yes — submit one request per link asynchronously and collect results as each webhook arrives; there's no need to poll a dashboard link by link.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/dev/short-url-stats

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.

curl -X POST https://api.kit.forhosting.com/dev/short-url-stats \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":"…"}'
{
  "input": "…"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "dev.short_url_stats",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →