-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yml
672 lines (638 loc) · 19.9 KB
/
openapi.yml
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
openapi: 3.0.2
info:
title: Arachnio API
description: Arachnio is an API product for creating structured data from the web.
contact:
email: api@arachn.io
version: 0.1.5
servers:
- url: https://api.arachn.io/v1
tags:
- name: link
description: Endpoints for processing hyperlinks
- name: domain
description: Endpoints for processing domain names
paths:
/domains/parse:
post:
tags:
- domain
summary: Parse a domain name
description: Parses a domain name into its component parts
operationId: parseDomainName
requestBody:
description: The domain name to parse
content:
application/json:
schema:
$ref: '#/components/schemas/DomainName'
responses:
200:
description: The domain name was parsed successfully
content:
application/json:
schema:
$ref: '#/components/schemas/ParsedDomainName'
/domains/parse/batch:
post:
tags:
- domain
summary: Parse a batch of domain names
description: Parses a batch of domain names into their component parts
operationId: parseDomainNameBatch
requestBody:
description: The batch of domain names to parse
content:
application/json:
schema:
$ref: '#/components/schemas/DomainNameBatch'
responses:
200:
description: The domain names were parsed successfully
content:
application/json:
schema:
$ref: '#/components/schemas/ParsedDomainNameBatch'
/links/parse:
post:
tags:
- link
summary: Parse a link
description: Parses an absolute hyperlink into its component parts
operationId: parseLink
requestBody:
description: The link to parse
content:
application/json:
schema:
$ref: '#/components/schemas/Link'
responses:
200:
description: The link was parsed successfully
content:
application/json:
schema:
$ref: '#/components/schemas/ParsedLink'
/links/parse/batch:
post:
tags:
- link
summary: Parse a batch of links
description: Parses a batch of absolute hyperlinks into their component parts
operationId: parseLinkBatch
requestBody:
description: The batch of links to parse
content:
application/json:
schema:
$ref: '#/components/schemas/LinkBatch'
responses:
200:
description: The links were parsed successfully
content:
application/json:
schema:
$ref: '#/components/schemas/ParsedLinkBatch'
/links/unwind:
post:
tags:
- link
summary: Unwind a link
description: Converts a link to its maximally unwound, and possibly canonical, form. For example, convert `https://nyti.ms/3rBgKkH` to `https://www.nytimes.com/2019/07/17/science/apollo-11-landing-anniversary.html`.
operationId: unwindLink
x-async-enabled: true
requestBody:
description: The link to unwind
content:
application/json:
schema:
$ref: '#/components/schemas/Link'
required: true
responses:
200:
description: The link was canonicalized successfully
content:
application/json:
schema:
$ref: '#/components/schemas/UnwoundLink'
/links/unwind/batch:
post:
tags:
- link
summary: Unwind a batch of links
description: Converts a batch of links to their maximally unwound, and possibly canonical, forms
operationId: unwindLinkBatch
x-async-enabled: true
requestBody:
description: The batch of links to unwind
content:
application/json:
schema:
$ref: '#/components/schemas/LinkBatch'
required: true
responses:
200:
description: The link was canonicalized successfully
content:
application/json:
schema:
$ref: '#/components/schemas/UnwoundLinkBatch'
/links/extract:
post:
tags:
- link
summary: Extract a link
description: Unwinds a link and attempts to extract structured microdata and body content
operationId: extractLink
x-async-enabled: true
requestBody:
description: The link to extract
content:
application/json:
schema:
$ref: '#/components/schemas/Link'
required: true
responses:
200:
description: The link was extracted successfully
content:
application/json:
schema:
$ref: '#/components/schemas/ExtractedLink'
components:
schemas:
Scheme:
description: An application-level protocol for exchanging hypermedia documents, namely http and https.
type: string
enum:
- http
- https
Authority:
description: A URL authority consisting of a required host and optional port.
type: object
required:
- host
properties:
host:
$ref: '#/components/schemas/Host'
port:
description: A TCP port number
example: 80
type: integer
minimum: 0
maximum: 65353
format: int32
Host:
description: The coordinate of a specific destination on the internet
type: object
required:
- type
properties:
type:
description: "The type of this host, one of: `domain`, `ipv4`, `ipv6`"
example: domain
type: string
discriminator:
propertyName: type
mapping:
domain: '#/components/schemas/DomainNameHost'
ipv4: '#/components/schemas/IpV4AddressHost'
ipv6: '#/components/schemas/IpV6AddressHost'
DomainNameHost:
allOf:
- $ref: '#/components/schemas/Host'
- description: A domain name coordinate typically resolved with DNS, e.g. www.google.com
type: object
properties:
domain:
$ref: '#/components/schemas/ParsedDomainName'
IpV4AddressHost:
allOf:
- $ref: '#/components/schemas/Host'
- description: An IPv4 address
example: 8.8.8.8
type: object
required:
- address
properties:
address:
type: string
IpV6AddressHost:
allOf:
- $ref: '#/components/schemas/Host'
- description: An IPv6 address, e.g.
example: 2001:4860:4860::8888
type: object
required:
- address
properties:
address:
type: string
QueryParameter:
description: A URL query parameter, e.g. `foo=bar`. All fields are urldecoded.
type: object
required:
- name
properties:
name:
description: The name of the query parameter
example: foo
type: string
value:
description: The value of the query parameter
example: bar
type: string
ParsedDomainName:
type: object
required:
- registrySuffix
- publicSuffix
- hostname
properties:
registrySuffix:
description: The top-level domain of this hostname
example: com
type: string
publicSuffix:
description: The top-level public suffix of this hostname
example: google.com
type: string
hostname:
description: The complete domain name
example: www.google.com
type: string
format: hostname
ParsedLink:
description: A URL that has been parsed into its constituent parts
type: object
required:
- link
- scheme
- authority
- path
properties:
link:
description: The original link
example: https://www.nytimes.com/2019/07/17/science/apollo-11-landing-anniversary.html
type: string
format: url
scheme:
$ref: '#/components/schemas/Scheme'
authority:
$ref: '#/components/schemas/Authority'
path:
description: The path from the original link
example: /2019/07/17/science/apollo-11-landing-anniversary.html
type: string
queryParameters:
description: The list of query parameters from the original link
type: array
items:
$ref: '#/components/schemas/QueryParameter'
UnwindingOutcome:
description: |
A description of the final outcome of unwinding a link
* `success2xx` -- The final hop completed with a 2xx status code. This typically indicates a successful unwinding.
* `failure4xx` -- The unwinding failed due to a 4xx status code.
* `failure5xx` -- The unwinding failed due to a 5xx status code.
* `timeout` -- The unwinding failed because it took too long.
* `tooManyHops` -- The unwinding failed due to too many hops.
* `protocolError` -- The unwinding failed because the server(s) did not follow the HTTP protocol.
* `networkingError` -- The unwinding failed due to an I/O error.
type: string
enum:
- success2xx
- failure4xx
- failure5xx
- timeout
- tooManyHops
- protocolError
- networkingError
UnwoundLink:
description: The result of a link unwinding operation
type: object
required:
- original
- unwound
- canonical
properties:
original:
$ref: '#/components/schemas/ParsedLink'
unwound:
$ref: '#/components/schemas/ParsedLink'
outcome:
$ref: '#/components/schemas/UnwindingOutcome'
canonical:
description: Either `true` if the unwound URL is canonical, or `false` otherwise. A URL is canonical if and only if the outcome is `success2xx` and the final entity is an HTML document that contains a canonical meta link.
example: true
type: boolean
ImageMetadata:
description: An extracted image
type: object
properties:
url:
description: The location of the file
example: https://www.example.com/path/to/image.jpg
type: string
format: url
width:
description: The natural width of the image, in pixels
example: 640
type: integer
format: int32
height:
description: The natural height of the image, in pixels
example: 480
type: integer
format: int32
EntityMetadata:
description: A description of an extracted page
type: object
properties:
entityType:
description: The type of this page, e.g., "webpage". For reasons of future-proofing, applications should ignore values they do not recognize.
example: "webpage"
type: string
discriminator:
propertyName: entityType
mapping:
other: '#/components/schemas/OtherEntityMetadata'
webpage: '#/components/schemas/WebpageEntityMetadata'
OtherEntityMetadata:
allOf:
- $ref: '#/components/schemas/EntityMetadata'
- type: object
Locale:
type: object
properties:
language:
type: string
description: An ISO 639-1 language code
example: "en"
maxLength: 2
country:
type: string
description: An ISO 3166-1 Alpha 2 country code
example: "US"
maxLength: 2
MetaTag:
type: object
additionalProperties:
type: string
WebpageEntityMetadata:
allOf:
- $ref: '#/components/schemas/EntityMetadata'
- type: object
properties:
webpageType:
description: The type of this webpage, e.g., "article". For reasons of future-proofing, applications should ignore values they do not recognize.
example: "article"
type: string
locale:
$ref: '#/components/schemas/Locale'
title:
description: The title of the page
example: "Men Walk On Moon"
type: string
maxLength: 256
metaTags:
type: array
items:
$ref: '#/components/schemas/MetaTag'
thumbnail:
$ref: '#/components/schemas/ImageMetadata'
description:
description: A description of the content of the page.
example: "Houston, Monday, July 21--Men have landed and walked on the moon. Two Americans, astronauts of Apollo 11, steered their fragile four-legged lunar module safely and smoothly to the historic landing yesterday at 4:17:40 P.M., Eastern daylight time."
type: string
maxLength: 1024
discriminator:
propertyName: webpageType
mapping:
article: '#/components/schemas/ArticleWebpageEntityMetadata'
other: '#/components/schemas/OtherWebpageEntityMetadata'
OtherWebpageEntityMetadata:
allOf:
- $ref: '#/components/schemas/WebpageEntityMetadata'
- type: object
Hyperlink:
type: object
properties:
href:
$ref: '#/components/schemas/ParsedLink'
rel:
type: string
description: The value of the `rel` attribute, e.g., `nofollow`, `author`, etc.
outlink:
type: boolean
description: Whether or not this link's destination points to a separate site
anchorText:
type: string
description: The text content of this link's tag
ArticleAuthor:
type: object
properties:
name:
description: The author's name
example: "John Noble Wilford"
type: string
ArticleWebpageEntityMetadata:
allOf:
- $ref: '#/components/schemas/WebpageEntityMetadata'
- type: object
properties:
keywords:
type: array
items:
type: string
author:
$ref: '#/components/schemas/ArticleAuthor'
publishedAt:
description: The timestamp when the page was originally published.
example: "1969-07-21T00:00:00Z"
type: string
format: date-time
modifiedAt:
description: The timestamp when the page was most recently modified.
example: "1969-07-21T00:00:00Z"
type: string
format: date-time
bodyHtml:
description: The sanitized contents of the page body. It may be truncated. Will always be a valid HTML fragment.
type: string
maxLength: 32768
bodyText:
description: The contents of the page body. It may be truncated.
type: string
maxLength: 32768
bodyLinks:
description: The list of hyperlinks embedded in this page's body content.
type: array
items:
$ref: '#/components/schemas/Hyperlink'
ExtractedLink:
description: A description of an extracted link
type: object
required:
- link
- metadata
properties:
link:
$ref: '#/components/schemas/UnwoundLink'
entity:
$ref: '#/components/schemas/EntityMetadata'
DomainName:
description: A domain name for parsing, etc.
type: object
required:
- hostname
properties:
hostname:
description: The hostname to parse
example: www.google.com
type: string
format: hostname
nullable: false
maxLength: 253
DomainNameBatchEntry:
description: An entry in a batch of domain names
type: object
required:
- id
- domain
properties:
id:
description: An ID for this entry. It must be unique within its batch.
type: string
maxLength: 80
domain:
$ref: '#/components/schemas/DomainName'
DomainNameBatch:
description: A batch of domain names
type: object
required:
- entries
properties:
entries:
description: The domain names
type: array
minLength: 1
maxLength: 100
items:
$ref: '#/components/schemas/DomainNameBatchEntry'
ParsedDomainNameBatchEntry:
description: An entry in a batch of parsed domain names
type: object
required:
- id
- parsedDomain
properties:
id:
description: An ID for this entry. It must be unique within its batch.
type: string
maxLength: 80
parsedDomain:
$ref: '#/components/schemas/ParsedDomainName'
ParsedDomainNameBatch:
description: A batch of parsed domain names
type: object
required:
- entries
properties:
entries:
description: The parsed domain names
type: array
minLength: 1
maxLength: 10
items:
$ref: '#/components/schemas/ParsedDomainNameBatchEntry'
Link:
description: A hyperlink for parsing, extracting, etc.
type: object
required:
- url
properties:
url:
description: The hyperlink
example: https://www.nytimes.com/2019/07/17/science/apollo-11-landing-anniversary.html
type: string
format: url
nullable: false
maxLength: 2048
LinkBatchEntry:
description: An entry in a batch of links
type: object
required:
- id
- link
properties:
id:
description: An ID for this entry. It must be unique within its batch.
type: string
maxLength: 80
link:
$ref: '#/components/schemas/Link'
LinkBatch:
description: A batch of links
type: object
required:
- entries
properties:
entries:
description: The links
type: array
minLength: 1
maxLength: 100
items:
$ref: '#/components/schemas/LinkBatchEntry'
ParsedLinkBatchEntry:
description: An entry in a batch of parsed links
type: object
required:
- id
- parsedLink
properties:
id:
description: An ID for this entry. It must be unique within its batch.
type: string
maxLength: 80
parsedLink:
$ref: '#/components/schemas/ParsedLink'
ParsedLinkBatch:
description: A batch of parsed links
type: object
required:
- entries
properties:
entries:
description: The parsed links
type: array
minLength: 1
maxLength: 10
items:
$ref: '#/components/schemas/ParsedLinkBatchEntry'
UnwoundLinkBatchEntry:
description: An entry in a batch of parsed links
type: object
required:
- id
- unwoundLink
properties:
id:
type: string
maxLength: 80
unwoundLink:
$ref: '#/components/schemas/UnwoundLink'
UnwoundLinkBatch:
description: A batch of unwound links
type: object
required:
- entries
properties:
entries:
description: The unwound links
type: array
minLength: 1
maxLength: 10
items:
$ref: '#/components/schemas/UnwoundLinkBatchEntry'