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

format

# JSON-LD

JSON-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.

JSON-LD (JavaScript Object Notation for Linked Data) encodes semantic data as a `<script type='application/ld+json'>` block within the page's HTML. The data describes the page's content in a vocabulary defined by schema.org — product prices, review ratings, event dates, organisation details, and more. Search engines parse JSON-LD blocks to power rich results in search listings.

For scrapers, JSON-LD is a high-quality extraction target because the data is clean and structured by the site operator — no fragile CSS selector or XPath is needed to extract product prices from rendered text. The schema.org vocabulary provides a predictable key set across different publishers using the same content type.

JSON-LD blocks can be extracted with a simple regex or HTML parser targeting the script tag, then parsed as standard JSON. Multiple JSON-LD blocks may appear on a single page for different schema types (e.g., a `Product` block alongside a `BreadcrumbList` block).

### What is JSON-LD?

JSON-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.

### How does AlterLab handle JSON-LD?

JSON-LD blocks can be extracted with a simple regex or HTML parser targeting the script tag, then parsed as standard JSON. Multiple JSON-LD blocks may appear on a single page for different schema types (e.g., a `Product` block alongside a `BreadcrumbList` block).

## Examples

```
from bs4 import BeautifulSoup
import json

soup = BeautifulSoup(html, "html.parser")
for tag in soup.find_all("script", type="application/ld+json"):
    data = json.loads(tag.string)
    if data.get("@type") == "Product":
        print(data.get("name"), data.get("offers", {}).get("price"))
```

## Related Terms

[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)[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)[Open Graph ProtocolOpen Graph is a protocol that uses meta tags in an HTML page's head to define how a URL is displayed when shared on social media platforms.](https://alterlab.io/glossary/open-graph)[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 JSON-LD 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)