Documentation for crwlr / schema-org (v0.1)

Getting Started

This library helps to extract structured data in JSON-LD format from HTML documents. It tries to find JavaScript tags in HTML containing JSON-LD objects, getting the data and populating instances of the equivalent classes from spatie's schema-org package. Shout-out to the awesome guys at spatie!


Requires PHP version 8.0 or above.


Install the latest version with:

composer require crwlr/schema-org


Using it is super simple:

use Crwlr\SchemaOrg\SchemaOrg;

$html = file_get_contents('');

$schemaOrgObjects = SchemaOrg::fromHtml($html);

The SchemaOrg::fromHtml() method returns an array with the objects (instances from the spatie schema-org package).