W3C Web API

TPAC 2015

W3C Web API

Vivien Lacourba, W3C Systems Team

TPAC October 2015

Sapporo, Japan

keyboard keys with the letters W 3 C

Background: Why a Web API?

Early discussions

W3C API

W3C API GitHub project

Available data

Currently only expose public data:

API Doc

Example: HTML5 REC

{
  status: "Recommendation",
  uri: http://www.w3.org/TR/2014/REC-html5-20141028/,
  date: "2014-10-28",
  informative: false,
  title: "HTML5",
  shortlink: http://www.w3.org/TR/html5/,
  editor-draft: http://www.w3.org/html/wg/drafts/html/master/,
  process-rules: http://www.w3.org/2005/10/Process-20051014/,
  _links: {
    self: { href: (...)/specifications/html5/versions/20141028 },
    editors: { href: (...)/specifications/html5/versions/20141028/editors },
    deliverers: { href: (...)/specifications/html5/versions/20141028/deliverers },
    specification: { href: (...)/specifications/html5 },
    predecessor-version: { href: (...)/specifications/html5/versions/20141028/predecessors }
  }
}
  

How to use it? (1/2)

API key

How to use it? (2/2)

Call the API passing the key as either a:

Restrictions

Details

Apiary logo Apiary comes to the rescue

      <html data-api-key="abc123def456">
        <head>
          <title class="apiary-name">[Loading…]</title>
        </head>
        <body data-group-id="68239">
          <h1>
            <span class="apiary-name">[Loading…]</span>
            <em class="apiary-type">[Loading…]</em>
          </h1>
          <p class="apiary-description">[Loading…]</p>
          <h2>Chairs</h2>
          <div class="apiary-chairs">[Loading…]</div>
          <script src="//www.w3.org/scripts/jquery/2.1/jquery.min"></script>
          <script src="//w3c.github.io/apiary/apiary.js"></script>
        </body>
      </html>
    

Apiary logo API data injected in the page

Before After

Example: https://w3c.github.io/apiary/examples/group.html

Apiary logo How to write a placeholder

Traverse JSON results and follow links up to the field in question; then concatenate with @ all property names present in the path.

GitHubMore on GitHub