-
Notifications
You must be signed in to change notification settings - Fork 92
/
index.html
83 lines (74 loc) · 2.95 KB
/
index.html
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
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<title>W3C API Overview</title>
<link rel="stylesheet" type="text/css" href="style/base.css" />
<h1>W3C API Overview</h1>
<section>
<h2 id=introduction>Introduction</h2>
<p>This page describes the resources forming the W3C API. If you have any problems or requests, please submit an <a href="https://github.com/w3c/w3c-api/issues">issue</a>.</p>
<p>The W3C API is public and doesn't require authentication.</p>
</section>
<section>
<h2 id=schema>Schema</h2>
<p>All API access is over HTTPS, and accessed from the <code>api.w3.org</code> domain. All data is sent and received as JSON.</p>
<p>The details about the different API endpoints are documented at <a href="https://api.w3.org/doc">https://api.w3.org/doc</a>.</p>
<pre>
$ curl -i https://api.w3.org/groups
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: public, s-maxage=900
Access-Control-Allow-Origin: *
Date: Mon, 23 Jul 2023 12:10:43 GMT
{...}
</pre>
<p>All timestamps are returned in ISO 8601 format:</p>
<pre>
YYYY-MM-DDTHH:MM:SSZ
</pre>
<h2 id=parameters>Parameters</h2>
<p>The W3C API takes optional parameters that can be passed as an HTTP query string parameter.</p>
<p>List of parameters:</p>
<table>
<thead>
<tr>
<td>Name</td>
<td>Value</td>
<td>Purpose</td>
<td>Example</td>
</tr>
</thead>
<tbody>
<tr>
<td><code>embed</code></td>
<td>boolean</td>
<td>By default, resources will be represented by links. On specific routes, the <code>embed</code> parameter allows to additionnaly embed related resources (see the <a href="http://stateless.co/hal_specification.html">HAL model</a> for more details)</td>
<td>https://api.w3.org/groups?embed=1</td>
</tr>
<tr>
<td><code>_doc</code></td>
<td>1</td>
<td>Show the documentation for a specific endpoint</td>
<td>https://api.w3.org/groups?_doc=1</td>
</tr>
<tr>
<td><code>items</code></td>
<td>Integer</td>
<td>Specify how many items should be listed on a page. Default value: 100, max value: 1000</td>
<td>https://api.w3.org/groups?items=10</td>
</tr>
<tr>
<td><code>page</code></td>
<td>Integer</td>
<td>Specify which page should be displayed, Default value: 1</td>
<td>https://api.w3.org/groups?page=2</td>
</tr>
</tbody>
</table>
<h2 id=http_verbs>HTTP verbs</h2>
<p>For now, the W3C API is read-only. Therefore the only HTTP verb we support is <code>GET</code>.</p>
<h2 id=pagination>Pagination</h2>
<p>As mentioned in the <a href="#parameters">parameters section</a>, requests that return multiple items will be paginated to 100 items by default. You can specify further pages with the <code>?page</code> parameter. For some resources, you can also set a custom page size up to 1000 with the <code>?items</code> parameter.</p>
<p>Note that page numbering is 1-based and that omitting the <code>?page</code> parameter will return the first page.</p>
</section>
</html>