# Stats

"Stats" refers to available statistics for clicks, auditory, geography etc. You can *access* Stats.

* [Summary stat](#summary-stat)
* [By Clicks](#by-clicks)
* [By Countries](#by-countries)
* [By Referers](#by-referers)
* [By Languages](#by-languages)
* [By Sharings](#by-sharings)
* Get clicks by date range

## Summary Stat

*GET* <https://to.click/api/v1/links/1129/stat>

*HEADERS*

```
Content-Type: application/json
X-AUTH-TOKEN: Token
```

### Sample Request

```
curl --request GET \
  --url https://to.click/api/v1/links/1129/stat \
  --header 'Content-Type: application/json' \
  --header 'X-AUTH-TOKEN: Token'
```

### Sample Response

```
{
    "data": {
        "clicks": 153,
        "countries": 21,
        "referers": 3,
        "platforms": 7,
        "languages": 10,
        "sharings": 1
    }
}
```

## By Clicks

*GET* <https://to.click/api/v1/links/1129/stat/clicks>

*HEADERS*

```
Content-Type: application/json
X-AUTH-TOKEN: Token
```

### Sample Request

```
curl --request GET \
  --url https://to.click/api/v1/links/1129/stat/clicks \
  --header 'Content-Type: application/json' \
  --header 'X-AUTH-TOKEN: Token'
```

### Sample Response

```
{
    "data": {
        "clicks": {
            "2018-01-10T12:39:47+03:00": 1,
            "2018-01-10T15:54:30+03:00": 1,
            "2018-01-13T03:56:03+03:00": 1,
            "2018-01-14T15:01:25+03:00": 1,
            "2018-01-17T21:03:41+03:00": 1,
            "2018-01-17T21:03:42+03:00": 1,
            "2018-01-19T13:22:04+03:00": 1,
            "2018-01-22T10:17:45+03:00": 1,
            "2018-01-26T10:33:27+03:00": 1,
            "2018-01-27T21:20:15+03:00": 1,
            "2018-01-29T12:26:07+03:00": 1,
            "2018-01-31T11:05:35+03:00": 1,
            "2018-02-04T20:43:54+03:00": 1,
            "2018-02-06T21:16:52+03:00": 1,
            "2018-02-09T16:06:02+03:00": 1,
    ...
            "2018-02-24T20:50:46+03:00": 1,
            "2018-02-25T11:51:21+03:00": 1,
            "2018-02-26T10:30:40+03:00": 1,
            "2018-02-27T11:42:34+03:00": 1,
            "2018-02-28T23:48:08+03:00": 1,
            "2018-03-01T18:44:33+03:00": 1
        }
    }
}
```

## By Countries

*GET* <https://to.click/api/v1/links/1129/stat/countries>

*HEADERS*

```
Content-Type: application/json
X-AUTH-TOKEN: Token
```

### Sample Request

```
curl --request GET \
  --url https://to.click/api/v1/links/1129/stat/countries \
  --header 'Content-Type: application/json' \
  --header 'X-AUTH-TOKEN: Token'
```

### Sample Response

```
{
    "data": {
        "countries": {
            "RU": 75,
            "UA": 22,
            "US": 24,
            "ES": 1,
            "IT": 1,
            "BY": 9,
            "IL": 1,
            "DE": 4,
            "MD": 2,
            "FR": 2,
            "AZ": 1,
            "CZ": 1,
            "RS": 1,
            "PT": 1,
            "LT": 2,
            "NO": 1,
            "AT": 1,
            "LV": 1,
            "TH": 1,
            "HK": 1,
            "KZ": 1
        }
    }
}
```

## By Referers

*GET* <https://to.click/api/v1/links/1129/stat/referers>

*HEADERS*

```
Content-Type: application/json
X-AUTH-TOKEN: Token
```

### Sample Request

```
curl --request GET \
  --url https://to.click/api/v1/links/1129/stat/referers \
  --header 'Content-Type: application/json' \
  --header 'X-AUTH-TOKEN: Token'
```

### Sample Response

```
{
    "data": {
        "referers": {
            "facebook.com": 1,
            "to.click": 2,
            "direct": 151
        }
    }
}
```

## By Platforms

*GET* <https://to.click/api/v1/links/1129/stat/platforms>

*HEADERS*

```
Content-Type: application/json
X-AUTH-TOKEN: Token
```

### Sample Request

```
curl --request GET \
  --url https://to.click/api/v1/links/1129/stat/platforms \
  --header 'Content-Type: application/json' \
  --header 'X-AUTH-TOKEN: Token'
```

### Sample Response

```
{
    "data": {
        "platforms": {
            "Mac OS": 21,
            "GNU/Linux": 4,
            "Google Inc.": 1,
            "Android": 45,
            "Windows": 61,
            "iOS": 21
        }
    }
}
```

## By Languages

*GET* <https://to.click/api/v1/links/1129/stat/languages>

*HEADERS*

```
Content-Type: application/json
X-AUTH-TOKEN: Token
```

### Sample Request

```
curl --request GET \
  --url https://to.click/api/v1/links/1129/stat/languages \
  --header 'Content-Type: application/json' \
  --header 'X-AUTH-TOKEN: Token'
```

### Sample Response

```
{
    "data": {
        "languages": {
            "ru": 37,
            "en-us": 17,
            "ru-ru": 90,
            "en-gb": 1,
            "en": 1,
            "uk": 1,
            "de-at": 1,
            "zh-cn": 1,
            "fr-fr": 1
        }
    }
}
```

## By Sharings

*GET* <https://to.click/api/v1/links/1129/stat/sharings>

*HEADERS*

```
Content-Type: application/json
X-AUTH-TOKEN: Token
```

### Sample Request

```
curl --request GET \
  --url https://to.click/api/v1/links/1129/stat/sharings \
  --header 'Content-Type: application/json' \
  --header 'X-AUTH-TOKEN: Token'
```

### Sample Response

```
{
    "data": {
        "sharings": {
            "Facebook": 10
        }
    }
}
```

## clicks by date range

<mark style="color:blue;">`GET`</mark> `https://to.click/api/v1/reports?event_name=click&start_date=2020-01-01&end_date=2020-01-10`

Get all the clicks for your links by specified date range

#### Path Parameters

| Name    | Type   | Description |
| ------- | ------ | ----------- |
| reports | string |             |

#### Query Parameters

| Name          | Type   | Description            |
| ------------- | ------ | ---------------------- |
| end\_date     | string | YYYY-MM-DD             |
| link\_source  | string | *hub* or *api*         |
| event\_source | string | *bot* or *human*       |
| event\_name   | string | Should be always click |
| start\_date   | string | YYYY-MM-DD             |

{% tabs %}
{% tab title="200 " %}

```
curl --request GET  --url 'https://to.click/api/v1/reports?event_name=click&start_date=2020-01-01&end_date=2020-01-10' --header 'Content-Type: application/json' --header 'X-AUTH-TOKEN: jb6LP5x2mSzUKsr7EyTiEbnW'
```

{% endtab %}
{% endtabs %}
