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

# Link statistics data by interval

Returns statistics for link grouped by interval

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Statistics API",
    "version": "2"
  },
  "paths": {
    "/link/{linkId}/by_interval": {
      "post": {
        "summary": "Link statistics data by interval",
        "operationId": "postLinkLinkidBy_interval",
        "description": "Returns statistics for link grouped by interval",
        "parameters": [
          {
            "name": "linkId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Model49"
              }
            }
          }
        },
        "tags": [
          "link"
        ],
        "security": [
          {
            "api_key": []
          }
        ],
        "responses": {
          "200": {
            "description": "link statistics",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/DomainByIntervalStatistics"
                }
              }
            }
          }
        }
      }
    }
  },
  "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": {
      "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"
        }
      },
      "CountriesFilter": {
        "type": "array",
        "description": "Return clicks from provided countries",
        "x-constraint": {
          "unique": true
        },
        "items": {
          "type": "string",
          "x-constraint": {
            "length": 2
          }
        }
      },
      "dt": {
        "type": "array",
        "x-constraint": {
          "length": 2
        },
        "items": {
          "type": "string",
          "format": "date"
        }
      },
      "BrowsersFilter": {
        "type": "array",
        "description": "Return clicks from provided browsers",
        "x-constraint": {
          "unique": true
        },
        "items": {
          "type": "string"
        }
      },
      "SocialsFilter": {
        "type": "array",
        "description": "Return clicks from provided social networks",
        "x-constraint": {
          "unique": true
        },
        "items": {
          "type": "string"
        }
      },
      "BrowserVersionsFilter": {
        "type": "array",
        "description": "Return clicks from provided browser versions",
        "x-constraint": {
          "unique": true
        },
        "items": {
          "type": "string"
        }
      },
      "StatusesFilter": {
        "type": "array",
        "description": "Return clicks with provided statuses",
        "items": {
          "type": "number"
        }
      },
      "PathsFilter": {
        "type": "array",
        "description": "Return clicks with provided paths",
        "items": {
          "type": "string"
        }
      },
      "ProtocolsFilter": {
        "type": "array",
        "description": "Return clicks with provided protocols",
        "items": {
          "type": "string"
        }
      },
      "ReferrerFilter": {
        "type": "array",
        "description": "Return clicks from provided referrers",
        "items": {
          "type": "string"
        }
      },
      "UTMSourceFilter": {
        "type": "array",
        "description": "Return clicks from provided utm sources",
        "items": {
          "type": "string"
        }
      },
      "UTMMediumFilter": {
        "type": "array",
        "description": "Return clicks from provided utm mediums",
        "items": {
          "type": "string"
        }
      },
      "UTMCampaignFilter": {
        "type": "array",
        "description": "Return clicks from provided utm campaigns",
        "items": {
          "type": "string"
        }
      },
      "period": {
        "type": "string",
        "description": "One of predefined time intervals. Select custom to provide custom dates",
        "default": "last30",
        "enum": [
          "custom",
          "today",
          "yesterday",
          "total",
          "week",
          "month",
          "lastmonth",
          "last7",
          "last30"
        ]
      },
      "clicksChartInterval": {
        "type": "string",
        "description": "One of predefined time intervals",
        "enum": [
          "hour",
          "day",
          "week",
          "month"
        ]
      },
      "DomainByIntervalStatistics": {
        "type": "object",
        "properties": {
          "clickStatistics": {
            "$ref": "#/components/schemas/DatasetData"
          }
        }
      },
      "Model45": {
        "type": "array",
        "description": "Return clicks with provided methods",
        "items": {
          "type": "string"
        }
      },
      "Model46": {
        "type": "object",
        "description": "Filter records by provided values",
        "properties": {
          "countries": {
            "$ref": "#/components/schemas/CountriesFilter"
          },
          "dt": {
            "$ref": "#/components/schemas/dt"
          },
          "browsers": {
            "$ref": "#/components/schemas/BrowsersFilter"
          },
          "human": {
            "type": "boolean",
            "description": "Returns human clicks only if true"
          },
          "socials": {
            "$ref": "#/components/schemas/SocialsFilter"
          },
          "browserVersions": {
            "$ref": "#/components/schemas/BrowserVersionsFilter"
          },
          "statuses": {
            "$ref": "#/components/schemas/StatusesFilter"
          },
          "paths": {
            "$ref": "#/components/schemas/PathsFilter"
          },
          "protos": {
            "$ref": "#/components/schemas/ProtocolsFilter"
          },
          "methods": {
            "$ref": "#/components/schemas/Model45"
          },
          "refhosts": {
            "$ref": "#/components/schemas/ReferrerFilter"
          },
          "utmSources": {
            "$ref": "#/components/schemas/UTMSourceFilter"
          },
          "utmMediums": {
            "$ref": "#/components/schemas/UTMMediumFilter"
          },
          "utmCampaigns": {
            "$ref": "#/components/schemas/UTMCampaignFilter"
          }
        }
      },
      "Model47": {
        "type": "array",
        "description": "Return clicks with provided methods",
        "items": {
          "type": "string"
        }
      },
      "Model48": {
        "type": "object",
        "description": "Exclude records with provided values",
        "properties": {
          "countries": {
            "$ref": "#/components/schemas/CountriesFilter"
          },
          "dt": {
            "$ref": "#/components/schemas/dt"
          },
          "browsers": {
            "$ref": "#/components/schemas/BrowsersFilter"
          },
          "human": {
            "type": "boolean",
            "description": "Returns human clicks only if true"
          },
          "socials": {
            "$ref": "#/components/schemas/SocialsFilter"
          },
          "browserVersions": {
            "$ref": "#/components/schemas/BrowserVersionsFilter"
          },
          "statuses": {
            "$ref": "#/components/schemas/StatusesFilter"
          },
          "paths": {
            "$ref": "#/components/schemas/PathsFilter"
          },
          "protos": {
            "$ref": "#/components/schemas/ProtocolsFilter"
          },
          "methods": {
            "$ref": "#/components/schemas/Model47"
          },
          "refhosts": {
            "$ref": "#/components/schemas/ReferrerFilter"
          },
          "utmSources": {
            "$ref": "#/components/schemas/UTMSourceFilter"
          },
          "utmMediums": {
            "$ref": "#/components/schemas/UTMMediumFilter"
          },
          "utmCampaigns": {
            "$ref": "#/components/schemas/UTMCampaignFilter"
          }
        }
      },
      "Model49": {
        "type": "object",
        "properties": {
          "include": {
            "$ref": "#/components/schemas/Model46"
          },
          "exclude": {
            "$ref": "#/components/schemas/Model48"
          },
          "period": {
            "$ref": "#/components/schemas/period"
          },
          "clicksChartInterval": {
            "$ref": "#/components/schemas/clicksChartInterval"
          },
          "tz": {
            "type": "string",
            "description": "Timezone name",
            "default": "UTC"
          },
          "startDate": {
            "type": "string",
            "format": "date",
            "description": "Returns statistics for clicks after given date. Required if period is custom"
          },
          "endDate": {
            "type": "string",
            "format": "date",
            "description": "Returns statistics for clicks before given date. Required if period is custom"
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```