# 获取短链接访问数据接口
# 请求
URL:https://api.xiaomark.com/v1/link/stats/get
请求方式:POST
请求参数格式:JSON
1
2
3
2
3
# 请求参数说明
参数名 | 类型 | 是否必传 | 描述 |
---|---|---|---|
apikey | string | 是 | 用户的API密钥 |
url | string | 是 | 短链接 |
start | string | 是 | 开始日期,按“yyyy-mm-dd”的格式传入 |
end | string | 是 | 结束日期,按“yyyy-mm-dd”的格式传入 |
备注:日期跨度不能超过 31 天。
# 请求POST数据示例
{
"apikey": "361f534e9897e75af4206ea820365fde",
"url": "https://sourl.cn/HOHzsG",
"start": "2020-10-15",
"end": "2020-10-19"
}
1
2
3
4
5
6
2
3
4
5
6
# 返回参数说明
名称 | 类型 | 描述 |
---|---|---|
code | integer | 返回码 |
message | string | 返回信息 |
data | object | 请求成功返回的数据 |
pv | integer | 总访问次数 |
uip | integer | 总访问IP数 |
uv | integer | 总访问人数 |
daily | object 数组 | 每日数据 |
weekday_stats | integer数组 | 一周分布数据(长度为7,对应周一到周日) |
hour_stats | integer数组 | 24小时分布数据(长度为24,对应0点到23点) |
top_ip_stats | object 数组 | Top 5 IP |
top_referer_stats | object 数组 | Top 5 referer |
locale_global_stats | object 数组 | 国际地区分布数据 |
locale_cn_stats | object 数组 | 中国地区分布数据 |
browser_stats | object 数组 | 浏览器分布数据 |
os_stats | object 数组 | 操作系统分布数据 |
device_stats | object 数组 | 设备类型分布数据 |
net_stats | object 数组 | 网络类型分布数据 |
# daily 对象详情
名称 | 类型 | 描述 |
---|---|---|
date | String | 日期 |
pv | integer | 访问次数 |
uip | integer | 访问IP数 |
uv | integer | 访问人数 |
# top_stats 对象详情
top_ip_stats
, top_referer_statss
返回的对象如下:
名称 | 类型 | 描述 | 归属对象 |
---|---|---|---|
ip | String | IP | top_ip_stats |
referer | String | Referer(空字符串表示直接访问) | top_referer_statss |
cnt | integer | 计数 | 都有 |
# locale_stats 对象详情
locale_global_stats
和 locale_cn_stats
返回的对象如下:
名称 | 类型 | 描述 | 归属对象 |
---|---|---|---|
locale | String | 地区 | 都有 |
cnt | integer | 计数 | 都有 |
ratio | integer | 占比 | 都有 |
# xxx-stats 对象详情
browser_stats
, os_stats
, device_stats
, net_stats
返回的对象如下:
名称 | 类型 | 描述 | 归属对象 |
---|---|---|---|
browser | String | 浏览器: wechat - 微信,qq - QQ,tencent - QQ浏览器,sogou - 搜狗浏览器,uc - UC浏览器,ie - IE,edge - Edge, chrome - Chrome,safari - Safari,firefox - Firefox,other - 其它 | browser_stats |
os | String | 操作系统:ios/android/windows/mac/linux/other | os_stats |
device | String | 设备类型:mobile/pc | device_stats |
net | String | 网络类型:mobile/broad | net_stats |
cnt | integer | 计数 | 都有 |
ratio | integer | 占比 | 都有 |
# 返回结果示例
{
"code": 0,
"data": {
"browser_stats": [
{
"browser": "chrome",
"cnt": 968,
"ratio": 0.32213
},
// ... 其他浏览器
{
"browser": "firefox",
"cnt": 14,
"ratio": 0.004659
}
],
"daily": [
{
"date": "2020-10-15",
"pv": 535,
"uip": 451,
"uv": 478
},
{
"date": "2020-10-16",
"pv": 709,
"uip": 575,
"uv": 593
},
{
"date": "2020-10-17",
"pv": 801,
"uip": 660,
"uv": 681
},
{
"date": "2020-10-18",
"pv": 515,
"uip": 441,
"uv": 453
},
{
"date": "2020-10-19",
"pv": 445,
"uip": 402,
"uv": 413
}
],
"device_stats": [
{
"cnt": 2747,
"device": "mobile",
"ratio": 0.914143
},
{
"cnt": 258,
"device": "pc",
"ratio": 0.085857
}
],
"hour_stats": [
158,104,62,38,34,42,36,39,83,97,108,125,166,181,174,161,147,152,151,168,152,208,212,207
],
"locale_cn_stats": [
{
"cnt": 405,
"locale": "广东",
"ratio": 0.134775
},
// ... 其他中国地区
{
"cnt": 2,
"locale": "香港",
"ratio": 0.000666
}
],
"locale_global_stats": [
{
"cnt": 2961,
"locale": "中国",
"ratio": 0.985358
},
{
"cnt": 9,
"locale": "英国",
"ratio": 0.002995
},
// ... 其他国家
{
"cnt": 1,
"locale": "新加坡",
"ratio": 0.000333
}
],
"net_stats": [
{
"cnt": 2642,
"net": "broad",
"ratio": 0.879201
},
{
"cnt": 363,
"net": "mobile",
"ratio": 0.120799
}
],
"os_stats": [
{
"cnt": 2176,
"os": "android",
"ratio": 0.724126
},
// ... 其他设备
{
"cnt": 565,
"os": "ios",
"ratio": 0.18802
}
],
"pv": 3005,
"top_ip_stats": [
{
"cnt": 10,
"ip": "183.217.211.23"
},
{
"cnt": 7,
"ip": "117.167.249.35"
},
{
"cnt": 7,
"ip": "36.98.213.98"
},
{
"cnt": 6,
"ip": "118.212.199.179"
},
{
"cnt": 6,
"ip": "117.61.240.185"
}
],
"top_referer_stats": [
{
"cnt": 269,
"referer": "https://sourl.cn/RDCzBw"
},
{
"cnt": 173,
"referer": "http://sourl.cn/PFbD3n"
},
{
"cnt": 138,
"referer": "https://sourl.cn/TXY5nH"
},
{
"cnt": 60,
"referer": "https://sourl.cn/BhEMSx"
},
{
"cnt": 46,
"referer": "https://sourl.cn/AkurGq"
}
],
"uip": 2516,
"uv": 2605,
"weekday_stats": [
445,0,0,535,709,801,515
]
},
"message": "请求成功"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
← 编辑短链接接口 获取短链接访问记录接口 →