---
title: "Link statistics"
method: POST
path: "/link/{linkId}"
tags: ["link"]
---

# Link statistics

`POST /link/{linkId}`

## Request

- Base URL: `https://statistics.short.io/statistics`
- URL: `https://statistics.short.io/statistics/link/{linkId}`
- Auth: API key in header `Authorization`

Returns detailed statistics for link in given period

## Path parameters

- `linkId` string, required

## Request body

- Model10
  - `include` Model7: Filter records by provided values
    - `countries` string[]: Return clicks from provided countries
    - `dt` string[]
    - `browsers` string[]: Return clicks from provided browsers
    - `human` boolean: Returns human clicks only if true
    - `socials` string[]: Return clicks from provided social networks
    - `browserVersions` string[]: Return clicks from provided browser versions
    - `statuses` number[]: Return clicks with provided statuses
    - `paths` string[]: Return clicks with provided paths
    - `protos` string[]: Return clicks with provided protocols
    - `methods` string[]: Return clicks with provided methods
    - `refhosts` string[]: Return clicks from provided referrers
    - `utmSources` string[]: Return clicks from provided utm sources
    - `utmMediums` string[]: Return clicks from provided utm mediums
    - `utmCampaigns` string[]: Return clicks from provided utm campaigns
  - `exclude` Model9: Exclude records with provided values
    - `countries` string[]: Return clicks from provided countries
    - `dt` string[]
    - `browsers` string[]: Return clicks from provided browsers
    - `human` boolean: Returns human clicks only if true
    - `socials` string[]: Return clicks from provided social networks
    - `browserVersions` string[]: Return clicks from provided browser versions
    - `statuses` number[]: Return clicks with provided statuses
    - `paths` string[]: Return clicks with provided paths
    - `protos` string[]: Return clicks with provided protocols
    - `methods` string[]: Return clicks with provided methods
    - `refhosts` string[]: Return clicks from provided referrers
    - `utmSources` string[]: Return clicks from provided utm sources
    - `utmMediums` string[]: Return clicks from provided utm mediums
    - `utmCampaigns` string[]: Return clicks from provided utm campaigns
  - `period` 'custom' | 'today' | 'yesterday' | 'total' | 'week' | 'month' | 'lastmonth' | 'last7' | 'last30': One of predefined time intervals. Select custom to provide custom dates
  - `tz` string: Timezone name
  - `startDate` string, date: Returns statistics for clicks after given date. Required if period is custom
  - `endDate` string, date: Returns statistics for clicks before given date. Required if period is custom
  - `skipTops` boolean: Skip top records
  - `clicksChartInterval` 'hour' | 'day' | 'week' | 'month': One of predefined time intervals

## Response `200`

link statistics

- LinkStatistics
  - `totalClicks` number, required: Total clicks number in interval
  - `humanClicks` number, required: Human clicks number in interval
  - `interval` Interval
    - `startDate` string, date-time: Start of the time interval for statistics
    - `endDate` string, date-time: End of the time interval for statistics
    - `prevStartDate` string, date-time: Start of the previous time interval for statistics
    - `prevEndDate` string, date-time: End of the previous time interval for statistics
  - `totalClicksChange` string: Difference between old number of clicks in previous and current period
  - `humanClicksChange` string: Difference between old number of human clicks in previous and current period
  - `clickStatistics` ClickStatistics
    - `datasets` Dataset[]
      - `data` DatasetItem[]
        - `y` number, required
        - `x` string, date, required
  - `referer` Referrer[]
    - `score` number, required
    - `referer` string, required
  - `social` Social[]
    - `score` number, required
    - `social` string, required
  - `browser` Browser[]
    - `score` number, required
    - `browser` string, required
  - `country` Country[]
    - `score` number, required
    - `country` string, required
    - `countryName` string, required
  - `city` City[]
    - `score` number
    - `city` string: Geoname ID of the city
    - `name` string: City name
    - `countryCode` string: Country code
  - `os` OS[]
    - `score` number
    - `os` string, required

---

[API](https://skmtc.dev/short/apis/statistics-api.md) - [All operations](https://skmtc.dev/short/apis/statistics-api/llms.txt) - [OpenAPI document](https://skmtc.dev/short/apis/statistics-api/revisions/b87df490eedc?raw)
