PHPackages                             darkfriend/schema-org-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. darkfriend/schema-org-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

darkfriend/schema-org-parser
============================

Parse schema.org microdata from HTML documents with ease. PHP Implementation of W3C Microdata to JSON Specification.

1.0.0(3y ago)020MITPHPPHP &gt;=7.0

Since Aug 17Pushed 3y agoCompare

[ Source](https://github.com/darkfriend/schema-org-parser)[ Packagist](https://packagist.org/packages/darkfriend/schema-org-parser)[ Docs](https://github.com/darkfriend/schema-org-parser)[ RSS](/packages/darkfriend-schema-org-parser/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Schema.org microdata parser
===========================

[](#schemaorg-microdata-parser)

---

*It`s fork from [yusufkandemir/microdata-parser](https://github.com/yusufkandemir/microdata-parser) for support **php7**.*

---

[![Latest Version on Packagist](https://camo.githubusercontent.com/09e80a0daf27f5b9355ad36295f8741362bdf4b22d93a9c42278bd5ece888456/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6461726b667269656e642f736368656d612d6f72672d7061727365722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/darkfriend/schema-org-parser)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![PHP Version Support](https://camo.githubusercontent.com/5b5b73911b5674daf59b3b424196c8d7e9fdddbfeba99a56967561c36e230406/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6461726b667269656e642f736368656d612d6f72672d7061727365723f7374796c653d666c61742d737175617265)](%5Blink-version%5D)[![Total Downloads](https://camo.githubusercontent.com/ed164c6413ffa8a8d21010c0a5bdadf6a55b375bf88933543751856080fb13ad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6461726b667269656e642f736368656d612d6f72672d7061727365722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/darkfriend/schema-org-parser)

This package aims to implement [W3C Microdata to JSON Specification](https://www.w3.org/TR/microdata/#json).

**microdata-parser** extracts microdata from documents.

Installation
------------

[](#installation)

Via Composer

```
$ composer require darkfriend/schema-org-parser
```

Usage
-----

[](#usage)

##### PHP

[](#php)

```
use Darkfriend\SchemaOrgParser\Microdata;

$microdata = Microdata::fromHTMLFile('source.html')->toJSON();
/* Other sources:
     fromHTML()        // from HTML string
     fromDOMDocument() // from DOMDocument object
   Other output methods:
     toArray()  // to Associtive PHP Array
     toObject() // to PHP Object (stdClass)
*/
```

##### Source as HTML

[](#source-as-html)

```

    Test Product

```

##### Result as JSON

[](#result-as-json)

```
{
  "items": [
    {
      "type": [ "http://schema.org/Product" ],
      "properties": {
        "image": [ "http://shop.example.com/test_product.jpg" ],
        "url": [ "http://shop.example.com/test_product" ],
        "name": [ "Test Product" ]
      }
    }
  ]
}
```

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Yusuf Kandemir](https://github.com/yusufkandemir)
- [Darkfriend](https://github.com/darkfriend)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1362d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/302f1cdc7cb85fc89550bad0c164e195b831f50de8a2a148fa754670d5f328cc?d=identicon)[darkfriend](/maintainers/darkfriend)

---

Top Contributors

[![yusufkandemir](https://avatars.githubusercontent.com/u/6266078?v=4)](https://github.com/yusufkandemir "yusufkandemir (56 commits)")[![darkfriend](https://avatars.githubusercontent.com/u/7825114?v=4)](https://github.com/darkfriend "darkfriend (2 commits)")[![eboye](https://avatars.githubusercontent.com/u/624357?v=4)](https://github.com/eboye "eboye (1 commits)")

---

Tags

jsonschemaparserW3CWHATWGschema.orgmicrodata

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/darkfriend-schema-org-parser/health.svg)

```
[![Health](https://phpackages.com/badges/darkfriend-schema-org-parser/health.svg)](https://phpackages.com/packages/darkfriend-schema-org-parser)
```

###  Alternatives

[justinrainbow/json-schema

A library to validate a json schema.

3.6k316.9M609](/packages/justinrainbow-json-schema)[salsify/json-streaming-parser

A streaming parser for JSON in PHP.

7766.7M14](/packages/salsify-json-streaming-parser)[yusufkandemir/microdata-parser

Parse microdata from HTML documents with ease. PHP Implementation of W3C Microdata to JSON Specification.

1756.1k](/packages/yusufkandemir-microdata-parser)[cerbero/json-parser

Zero-dependencies pull parser to read large JSON from any source in a memory-efficient way.

803474.6k5](/packages/cerbero-json-parser)[pcrov/jsonreader

JSON Pull Parser

1451.2M5](/packages/pcrov-jsonreader)[bcncommerce/json-stream

A bundle of tools to work with JSON in PHP

642.2M3](/packages/bcncommerce-json-stream)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
