---
updatedAt: 2025-11-05T21:12:52.000Z
agentTools:
  projectIndex: https://developers.short.io/llms.txt
---

# Link statistics

Returns detailed statistics for link in given period

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Statistics API",
    "version": "2"
  },
  "paths": {
    "/link/{linkId}": {
      "get": {
        "summary": "Link statistics",
        "operationId": "getLinkLinkid",
        "description": "Returns detailed statistics for link in given period",
        "parameters": [
          {
            "name": "linkId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "One of predefined time intervals. Select custom to provide custom dates",
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "custom",
                "today",
                "yesterday",
                "total",
                "week",
                "month",
                "lastmonth",
                "last7",
                "last30"
              ],
              "default": "last30"
            }
          },
          {
            "description": "Timezone name",
            "name": "tz",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "UTC"
            }
          },
          {
            "description": "Returns statistics for clicks after given date. Required if period is custom",
            "name": "startDate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "description": "Returns statistics for clicks before given date. Required if period is custom",
            "name": "endDate",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "description": "Skip top records",
            "name": "skipTops",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "description": "One of predefined time intervals",
            "name": "clicksChartInterval",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "hour",
                "day",
                "week",
                "month"
              ]
            }
          }
        ],
        "tags": [
          "link"
        ],
        "security": [
          {
            "api_key": []
          }
        ],
        "responses": {
          "200": {
            "description": "link statistics",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/LinkStatistics"
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://statistics.short.io/statistics"
    }
  ],
  "components": {
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header",
        "description": "For authentication you need an API key. You can find it in your\n                      [Integrations page](https://app.short.io/settings/integrations/api-key)\n                      "
      }
    },
    "schemas": {
      "Interval": {
        "type": "object",
        "properties": {
          "startDate": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the time interval for statistics",
            "example": "2019-09-11T02:59:59.999Z"
          },
          "endDate": {
            "type": "string",
            "format": "date-time",
            "description": "End of the time interval for statistics",
            "example": "2019-08-11T02:59:59.000Z"
          },
          "prevStartDate": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the previous time interval for statistics",
            "example": "2019-07-11T03:00:00.000Z"
          },
          "prevEndDate": {
            "type": "string",
            "format": "date-time",
            "description": "End of the previous time interval for statistics",
            "example": "2019-08-11T03:00:00.000Z"
          }
        }
      },
      "DatasetItem": {
        "type": "object",
        "properties": {
          "y": {
            "type": "number",
            "example": 5
          },
          "x": {
            "type": "string",
            "format": "date",
            "example": "2019-08-11T03:00:00.000Z"
          }
        },
        "required": [
          "y",
          "x"
        ]
      },
      "DatasetData": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/DatasetItem"
        }
      },
      "Dataset": {
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/DatasetData"
          }
        }
      },
      "DatasetList": {
        "type": "array",
        "x-constraint": {
          "single": true
        },
        "items": {
          "$ref": "#/components/schemas/Dataset"
        }
      },
      "ClickStatistics": {
        "type": "object",
        "properties": {
          "datasets": {
            "$ref": "#/components/schemas/DatasetList"
          }
        }
      },
      "Referrer": {
        "type": "object",
        "properties": {
          "score": {
            "type": "number",
            "example": 123
          },
          "referer": {
            "type": "string",
            "example": "google.com"
          }
        },
        "required": [
          "score",
          "referer"
        ]
      },
      "ReferrerList": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Referrer"
        }
      },
      "Social": {
        "type": "object",
        "properties": {
          "score": {
            "type": "number",
            "example": 123
          },
          "social": {
            "type": "string",
            "example": "Facebook"
          }
        },
        "required": [
          "score",
          "social"
        ]
      },
      "SocialList": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Social"
        }
      },
      "Browser": {
        "type": "object",
        "properties": {
          "score": {
            "type": "number",
            "example": 54
          },
          "browser": {
            "type": "string",
            "example": "Firefox"
          }
        },
        "required": [
          "score",
          "browser"
        ]
      },
      "BrowserList": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Browser"
        }
      },
      "Country": {
        "type": "object",
        "properties": {
          "score": {
            "type": "number",
            "example": 54
          },
          "country": {
            "type": "string",
            "example": "US",
            "pattern": "\\w{2}"
          },
          "countryName": {
            "type": "string",
            "example": "United States"
          }
        },
        "required": [
          "score",
          "country",
          "countryName"
        ]
      },
      "CountryList": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/Country"
        }
      },
      "City": {
        "type": "object",
        "properties": {
          "score": {
            "type": "number"
          },
          "city": {
            "type": "string",
            "description": "Geoname ID of the city",
            "example": "5393015"
          },
          "name": {
            "type": "string",
            "description": "City name",
            "example": "Santa Clara"
          },
          "countryCode": {
            "type": "string",
            "description": "Country code",
            "example": "US"
          }
        }
      },
      "CityList": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/City"
        }
      },
      "OS": {
        "type": "object",
        "properties": {
          "score": {
            "type": "number",
            "example": 13,
            "x-constraint": {
              "sign": "positive"
            }
          },
          "os": {
            "type": "string",
            "example": "Windows"
          }
        },
        "required": [
          "os"
        ]
      },
      "OSList": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/OS"
        }
      },
      "LinkStatistics": {
        "type": "object",
        "properties": {
          "totalClicks": {
            "type": "number",
            "description": "Total clicks number in interval",
            "example": 12345,
            "minimum": 0
          },
          "humanClicks": {
            "type": "number",
            "description": "Human clicks number in interval",
            "example": 10000,
            "minimum": 0
          },
          "interval": {
            "$ref": "#/components/schemas/Interval"
          },
          "totalClicksChange": {
            "type": "string",
            "description": "Difference between old number of clicks in previous and current period",
            "example": "34.53",
            "pattern": "\\d+.\\d{2}"
          },
          "humanClicksChange": {
            "type": "string",
            "description": "Difference between old number of human clicks in previous and current period",
            "example": "-67.15",
            "pattern": "\\d+.\\d{2}"
          },
          "clickStatistics": {
            "$ref": "#/components/schemas/ClickStatistics"
          },
          "referer": {
            "$ref": "#/components/schemas/ReferrerList"
          },
          "social": {
            "$ref": "#/components/schemas/SocialList"
          },
          "browser": {
            "$ref": "#/components/schemas/BrowserList"
          },
          "country": {
            "$ref": "#/components/schemas/CountryList"
          },
          "city": {
            "$ref": "#/components/schemas/CityList"
          },
          "os": {
            "$ref": "#/components/schemas/OSList"
          }
        },
        "required": [
          "totalClicks",
          "humanClicks"
        ]
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```