JSON-LD Structured Data Extractor
Extract valid application/ld+json script documents from HTML as normalized JSON strings, without resolving remote contexts.
Description
JSON-LD can embed linked-data documents in application/ld+json script elements.
When to use JSON-LD Structured Data Extractor
Use this tool to extract valid application/ld+json script documents from HTML as normalized JSON strings, without resolving remote contexts.
Choose the URL, decoded source text, header value or explicit byte list requested by this tool. Paste the complete relevant input and follow its parsing and encoding conventions.
How to use JSON-LD Structured Data Extractor and understand its results
- Choose the URL, decoded source text, header value or explicit byte list requested by this tool. Paste the complete relevant input and follow its parsing and encoding conventions.
- Enter html using the field table and calculation rules, then run the tool.
- Read documents. The explanation below defines the units, signs, ordering and any flags or placeholder values.
- If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
| Input field | Meaning | Value type; see rules below | Requirement |
|---|---|---|---|
| html | HTML source containing JSON-LD script elements. | string; maximum length: 1000000 | Required |
Paste HTML source. The scanner collects script text when its trimmed case-insensitive type is application/ld+json. Each document must parse as a JSON object or array. Return normalized JSON strings in source order; malformed JSON, scalar documents or an unclosed collected script are errors. No matching scripts returns an empty list.
documents=JSON.stringify(JSON.parse(scriptText)) for matching closed scripts Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.
| Output field | Meaning | Value type |
|---|---|---|
| documents | Normalized JSON-LD document strings. | list of string; maximum length: 1000000; minimum entries: 0; maximum entries: 100000 |
{
"input": {
"html": "<script type=\"application/ld+json\">{ \"@type\": \"Article\", \"name\": \"Example\" }</script>"
},
"output": {
"documents": [
"{\"@type\":\"Article\",\"name\":\"Example\"}"
]
}
} Limitations and assumptions
Remote contexts are not fetched and JSON-LD semantics are not validated. Script text is not HTML-entity decoded, and source scanning does not execute JavaScript or implement all browser recovery rules.
Numeric inputs must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Extremely large text inputs are rejected. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors.
Alternative or Complementary methods
Use Meta Tag Parser: Extract named meta entries from HTML source in document order, preserving repeated keys. For a complementary task, use Import Map Parser: Parse imports and scopes from import-map JSON into portable entries, preserving null addresses and leaving URL resolution to the caller.
Further background: JSON-LD 1.1: embedding documents in HTML.
References
Similar or alternative tools
- Meta Tag Parser
Extract named meta entries from HTML source in document order, preserving repeated keys.
- Import Map Parser
Parse imports and scopes from import-map JSON into portable entries, preserving null addresses and leaving URL resolution to the caller.