w3c-api icon indicating copy to clipboard operation
w3c-api copied to clipboard

Improving /specifications

Open plehegar opened this issue 5 years ago • 1 comments

For all specifications, I find myself systematically accessing the latest-version/status in order to:

  1. eliminate retired specifications from the lists
  2. display the status of a specification

This generates a lot of subsequent API calls.

is it possible to expose specification/latest-version/status directly as specification/status, and have a way to only retrieve active specifications?

plehegar avatar Jun 18 '19 21:06 plehegar

Hi @plehegar,

You can get this info using a single API call (modulo the pagination for long results) from: https://api.w3.org/specifications?embed=1

From that list you will have the status of the latest version of each specification (each specification status can be seen in the title attribute of the latest-version link ).

Below an extract from the above API call result showing one specification (ATAG10) with the Recommendation status and one (becss) with the Retired status.

{
  "page": 1,
  "limit": 100,
  "pages": 14,
  "total": 1326,
  (...)
  "_embedded": {
    "specifications": [
      {
        "shortlink": "http://www.w3.org/TR/ATAG10/",
        "title": "Authoring Tool Accessibility Guidelines 1.0",
        "shortname": "ATAG10",
        (...)
        "_links": {
          (...)
          "latest-version": {
            "href": "https://api.w3.org/specifications/ATAG10/versions/20000203",
            "title": "Recommendation"
          }
        }
      },
      (...)
      {
        "shortlink": "http://www.w3.org/TR/becss/",
        "title": "Behavioral Extensions to CSS",
        "shortname": "becss",
        (...)
        "_links": {
          (...)
          "latest-version": {
            "href": "https://api.w3.org/specifications/becss/versions/20141014",
            "title": "Retired"
          }
        }
      },
      (...)
    ]
  }
}

For all specifications, I find myself systematically accessing the latest-version/status in order to:

  1. eliminate retired specifications from the lists

Unfortunately with the current W3C API code it is not possible to filter on the server side the results to omit the specifications with a Retired status (see #76).

vivienlacourba avatar Jun 19 '19 09:06 vivienlacourba