What Spatie Schema.org does
spatie/schema-org is a PHP package that provides a fluent builder for every Schema.org type and its properties. Its classes are generated from Schema.org's JSON-LD standards file, release 13.0, so the code covers the core vocabulary. A type is created through the Schema facade, properties are set by chained method calls, and toScript() returns the result as an ld+json script block ready to place in a page.
The package includes a Graph object for combining several entities on one page, with node identifiers to keep track of them, and it handles multi typed entities. Since v1.6.0 it covers enumerations, and since v2.6.0 the identifier key maps to @id. An advanced method sets custom properties outside the generated set. One known issue: the Float type is unavailable because float is a reserved keyword in PHP.
Key features
- Fluent builder for all types
- Objects and methods for the entire core Schema.org vocabulary, generated from the official JSON-LD standards file.
- ld+json script output
- Calling toScript() returns a script tag of type application/ld+json with the serialised markup.
- Nested type composition
- Properties accept other Schema instances, so a localBusiness can hold a contactPoint built in the same chain.
- Graph for multiple items
- A Graph class collects several entities and provides utilities for emitting them together on one page.
- Graph node identifiers
- Node identifiers let code keep track of and reference multiple Graph nodes across a page.
- Multi typed entities
- Supports Schema.org multi typed entities, where one item carries more than one type.
- Enumeration support
- All Schema.org enumerations are available as of version 1.6.0.
- Identifier maps to @id
- As of version 2.6.0 the identifier key is written as @id in the generated output.
- Custom property setter
- An advanced method sets a property that is not part of the generated class API.
- Composer installation
- Installed with composer require spatie/schema-org, with no separate configuration step described.
- MIT licence
- Published under the MIT licence, with the licence file in the repository.
How it works
- Install the package with composer require spatie/schema-org.
- Instantiate a type through the Spatie\SchemaOrg\Schema facade, for example Schema::localBusiness().
- Chain property methods such as name(), email() and contactPoint().
- Pass nested Schema instances to properties that hold other types.
- Call toScript() to emit the ld+json script block, or add items to a Graph for multiple entities.
Plans and pricing
The package is free to use under the MIT licence; Spatie asks for a postcard and sells paid products to fund its open source work.
Integrations and platforms
Works with
- Schema.org
- Composer
Available as
- Web
Repository facts
- Repositoryspatie/schema-org
- LanguagePHP
- Stars1512
- Forks145
- LicenceMIT
- Created2016-11-24
- Last commit2026-11-05
- Open issues0
- php
- schedule
- schema
- seo
Services and details
Does SEO work itself
YesFree plan or free tools
YesAPI or MCP server
Yes
No information yet on keyword research, content optimization, writes content with AI, technical audits, rank tracking, backlinks and link building, local SEO, AI search visibility, free trial, WordPress plugin, browser extension, built for agencies. The website did not say; check with the vendor.
About the company
- Company spatie
- Website: github.com/spatie/schema-org
Listing compiled from public sources and the product's own website. Last updated 2026-11-12. Report a correction or request removal. Back to GitHub repos.