```yaml
product: AlterLab
title: "Microdata — Web Scraping Glossary | AlterLab"
comparison_context: "AlterLab is an alternative to Firecrawl, ScrapingBee, and Bright Data."
source_url: https://alterlab.io/glossary/microdata
```

format

# Microdata

Microdata is an HTML specification for embedding machine-readable structured data directly in HTML elements using `itemscope`, `itemtype`, and `itemprop` attributes.

Microdata was introduced alongside HTML5 as an in-band method of annotating existing HTML markup with semantic meaning. An element with `itemscope` defines a new item; `itemtype` specifies the schema type URL (typically schema.org); and `itemprop` attributes on descendant elements name the properties being described. Unlike JSON-LD, Microdata is interleaved with the visible HTML rather than separated into a script block.

From a scraping standpoint, Microdata is harder to parse than JSON-LD because the property values are embedded in diverse HTML attributes (`content`, `href`, `src`, `datetime`, or the element's text content) depending on the element type. Libraries such as Python's `extruct` can extract Microdata, JSON-LD, and RDFa from a page simultaneously and return them in a unified format.

Microdata's use has declined in favour of JSON-LD, which is preferred by Google and easier for developers to maintain without touching the visual HTML. However, older sites and CMS platforms still use Microdata heavily.

### What is Microdata?

Microdata is an HTML specification for embedding machine-readable structured data directly in HTML elements using `itemscope`, `itemtype`, and `itemprop` attributes.

### How does AlterLab handle Microdata?

Microdata's use has declined in favour of JSON-LD, which is preferred by Google and easier for developers to maintain without touching the visual HTML. However, older sites and CMS platforms still use Microdata heavily.

## Examples

```
# extruct: parse all structured data formats from HTML
import extruct
import requests

response = requests.get("https://example.com/product")
data = extruct.extract(response.text, base_url="https://example.com",
                       syntaxes=["json-ld", "microdata", "rdfa"])
print(data["microdata"])
```

## Related Terms

[Schema.orgSchema.org is a collaborative vocabulary of structured data types used to annotate web content so search engines and automated tools can understand its meaning.](https://alterlab.io/glossary/schema-org)[JSON-LDJSON-LD is a W3C standard for embedding structured, machine-readable data inside an HTML page's script tags using JSON syntax and schema.org vocabulary.](https://alterlab.io/glossary/json-ld)[Structured Data ExtractionConverting free-form HTML into typed JSON records using explicit schemas, producing clean structured output instead of raw markup.](https://alterlab.io/glossary/structured-data-extraction)[Data ExtractionThe process of identifying and pulling specific fields from raw web content, converting unstructured HTML into typed JSON records.](https://alterlab.io/glossary/data-extraction)[Parse TreeThe hierarchical tree structure created by an HTML parser that represents the DOM elements of a web page for programmatic traversal.](https://alterlab.io/glossary/parse-tree)

## Extract Microdata data from any website

AlterLab returns clean, structured data from any public URL — no scraper infrastructure needed. Start free, no credit card required.

[View API docs](https://alterlab.io/docs/api/rest)

[Back to Glossary](https://alterlab.io/glossary)