Using the primary API, you can place a request as such:

  curl https://html.haus/api/elements/abbr.json

You will receive a result that looks like this:

    "name": "abbr",
    "description": "Abbreviation element represents an acronym",
    "code": "https://html.haus/api/elements/abbr.html",
    "url": "https://html.haus/reference.html#abbr"

You can use references to code to also request the sample HTML:

  curl https://html.haus/api/elements/abbr.html

A comprehensive list of all elements supported is available here:

  curl https://html.haus/api/index.json


Ultimately, this means you can use JavaScript fetch functions to query the API using this formula:


Here's an example using the standard fetch() function:

  fetch('https://html.haus/api/elements/${element-name}.json').then(function (response) {
    // The API call was successful!
    return response.json();
  }).then(function (html) {
    // This is the JSON from our response
  }).catch(function (err) {
    // There was an error
    console.warn('Something went wrong.', err);