Extract Lists & Tables API

lists contains the page's top-level lists, each with a context such as nav, main or footer. tables contains every table with its caption, headers and rows.

API Examples

Lists

Lists

JSON Example

{
  ...
  "lists": [
    ...
    {
      "position": 13,
      "type": "ul",
      "title": "See also",
      "context": "main",
      "items": [
        "Coffee cup sleeve",
        "Coffee cup",
        "Coffee cupping",
        "Coffee in Japan",
        "Coffee in South Korea",
        "Colombian coffee growing axis",
        "Eight O'Clock Coffee",
        "Khat",
        "List of coffee dishes",
        "List of coffee drinks",
        "List of coffeehouse chains",
        "Sanka",
        "Third-wave coffee",
        "Viennese coffee house"
      ]
    }
  ]
}

Tables

Tables

JSON Example

{
  ...
  "tables": [
    {
      "position": 1,
      "caption": "Coffee",
      "rows": [
        ["Latte and black filtered coffee"],
        ["Type",               "Usually hot; can be iced"],
        ["Origin",             "Yemen[1][2][3]"],
        ["Introduced",         "15th century"],
        ["Color",              "Black, dark brown, light brown, beige"],
        ["Flavor",             "Distinctive, somewhat bitter"],
        ["Ingredients",        "Roasted coffee beans"],
        ["Standard drinkware", "Mug"]
      ]
    }
  ]
}

JSON Structure Overview

{
  ...
  "lists": [
    {
      "position": "Integer - Position of the list",
      "type": "String - List element. Can be 'ul' or 'ol'",
      "title": "String - aria-label of the list, or the heading before it",
      "context": "String - Closest page landmark. Can be 'nav', 'header', 'footer', 'aside', 'main', 'article' or 'body'",
      "items": "Array - Text of each list item, up to 100"
    },
    ...
  ],
  "tables": [
    {
      "position": "Integer - Position of the table",
      "caption": "String - Caption of the table",
      "headers": "Array - Header cells of the table",
      "rows": "Array - Rows of the table, each an array of cell texts"
    },
    ...
  ],
  ...
}