-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathapiary.apib
240 lines (158 loc) · 5.82 KB
/
apiary.apib
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
XFORMAT: 1A
HOST: http://udger-webservice.org/
# udger-local-api
Udger-webservice REST-API provides access to [udger-webservice](https://github.com/udger/udger-local-api) docker container.
# API Versions and changes
## 0.1
* First version available.
# Group parse
## User Agent Parser [/parse/ua/{ua}]
Parse single user agent string.
+ Parameters
+ ua: Mozilla%2F5.0+%28Windows+NT+10.0%3B+WOW64%3B+rv%3A40.0%29+Gecko%2F20100101+Firefox%2F40.0 (string) - base64 encoded user agent string
### GET
Get parsed user agent.
+ Response 200 (application/json)
+ Attributes (UaResult)
+ Response 400 (application/text)
## IP Parser [/parse/ip/{ip}]
Parse single IP string.
+ Parameters
+ ip: 108.61.199.93 (string) - IP string
### GET
Get parsed IP.
+ Response 200 (application/json)
+ Attributes (IpResult)
+ Response 400 (application/text)
## UA + IP Parser [/parse/ua={ua}&ip={ip}]
Parse single user agent string.
+ Request
+ ua: Mozilla%2F5.0+%28Windows+NT+10.0%3B+WOW64%3B+rv%3A40.0%29+Gecko%2F20100101+Firefox%2F40.0 (string) - base64 encoded user agent string
+ ip: 108.61.199.93 (string) - IP string
+ Response 200 (application/json)
{
"user_agent": { (UaResult) },
"ip_address": { (IpResult) }
}
+ Response 400
# Group set
Handles database file downloading / updating.
## Client key [/set/key{?access_key}]
Set client key used in db update operation.
+ Parameters
+ access_key: XYZ (string) - client key
### POST
Set client key
+ Response 200 (application/text)
OK
+ Response 400 (application/text)
Invalid key
## Database download [/set/updatedata]
Update database file from `http://data.udger.com/{key}/udgerdb_v3.dat.gz`
### POST
Update database file
+ Response 200 (application/text)
OK
+ Response 400 (application/text)
## Daily update [/set/autoupdate{?time}]
Set time of daily autoupdate in form HH:mm
+ Parameters
+ time: 10:30 (string) - set time of periodic update in form HH:mm
### POST
Set time of daily autoupdate
+ Response 200 (application/text)
OK
+ Response 400 (application/text)
## Database upload [/set/datafile]
Upload data file. Accepts data in gz format.
### POST
+ Parameters
+ file (file, required) - {FILE} File to upload.
+ Request (multipart/form-data)
# Group statistic
## Parser statistics [/statistic]
Gets parser statistics.
### GET
+ Response 200 (application/json)
{
"total_requests_ua": 989293,
"total_requests_ip": 271799,
"total_nanos_ua": 394022541322,
"total_nanos_ip": 367258877296,
"avg_throughput_ua": 2702.53,
"avg_throughput_ip": 791.89
}
# Data Structures
## UaResult (object)
- user_agent: (string)
- ua_string: Mozilla/5.0 compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0 (string)
- ua_class: Browser (string)
- ua_class_code: browser (string)
- ua: IE 10.0 (string)
- ua_version: 10.0 (string)
- ua_version_major: 10 (string)
- ua_uptodate_current_version: 11 (string)
- ua_family: IE (string)
- ua_family_code: ie (string)
- ua_family_homepage: https://en.wikipedia.org/wiki/Internet_Explorer (string)
- ua_family_vendor: Microsoft Corporation. (string)
- ua_family_vendor_code: microsoft_corporation (string)
- ua_family_vendor_homepage: https://www.microsoft.com/about/ (string)
- ua_family_icon: msie.png (string)
- ua_family_icon_big: msie_big.png (string)
- ua_family_info_url: https://udger.com/resources/ua-list/browser-detail?browser=IE (string)
- ua_engine: Trident (string)
- os: Windows 7 (string)
- os_code: windows_7 (string)
- os_homepage: https://en.wikipedia.org/wiki/Windows_7 (string)
- os_icon: windows-7.png (string)
- os_icon_big: windows-7_big.png (string)
- os_info_url: https://udger.com/resources/ua-list/os-detail?os=Windows 7 (string)
- os_family: Windows (string)
- os_family_code: windows (string)
- os_family_vendor: Microsoft Corporation. (string)
- os_family_vendor_code: microsoft_corporation (string)
- os_family_vendor_homepage: https://www.microsoft.com/about/ (string)
- device_class: Desktop (string)
- device_class_code: desktop (string)
- device_class_icon: desktop.png (string)
- device_class_icon_big: desktop_big.png (string)
- device_class_info_url: https://udger.com/resources/ua-list/device-detail?device=Desktop (string)
- device_brand: (string)
- device_brand_code: (string)
- device_brand_homepage: (string)
- device_brand_icon: (string)
- device_brand_icon_big: (string)
- device_brand_info_url: (string)
- crawler_last_seen: (string)
- crawler_category: (string)
- crawler_category_code: (string)
- crawler_respect_robotstxt: (string)
## IpResult (object)
- ip: 66.249.64.1 (string)
- ip_ver: 4 (number)
- ip_classification: Crawler (string)
- ip_classification_code: crawler (string)
- ip_hostname: crawl-66-249-64-1.googlebot.com (string)
- ip_last_seen: 2016-01-12 08:31:41 (string)
- ip_country: United States (string)
- ip_country_code: US (string)
- ip_city: Mountain View (string)
- crawler_name: Googlebot/2.1 (string)
- crawler_ver: 2.1 (string)
- crawler_ver_major: 2 (string)
- crawler_family: Googlebot (string)
- crawler_family_code: googlebot (string)
- crawler_family_homepage: http://www.google.com/bot.html (string)
- crawler_family_vendor: Google Inc. (string)
- crawler_family_vendor_code: google_inc (string)
- crawler_family_vendor_homepage: https://www.google.com/about/company/ (string)
- crawler_family_icon: bot_googlebot.png (string)
- crawler_family_info_url: https://udger.com/resources/ua-list/bot-detail?bot=Googlebot (string)
- crawler_last_seen: 2016-03-14 07:40:11 (string)
- crawler_category: Search engine bot (string)
- crawler_category_code: search_engine_bot (string)
- crawler_respect_robotstxt: yes (string)
- datacenter_name: (string)
- datacenter_name_code: (string)
- datacenter_homepage: (string)