PHPackages                             malenki/microdata - 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. malenki/microdata

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

malenki/microdata
=================

Get microdata from web page and check each type found with schema.org!

1.1(12y ago)9388[4 issues](https://github.com/malenkiki/microdata/issues)MITPHPPHP &gt;=5.3.0

Since Feb 24Pushed 5y ago3 watchersCompare

[ Source](https://github.com/malenkiki/microdata)[ Packagist](https://packagist.org/packages/malenki/microdata)[ RSS](/packages/malenki-microdata/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

microdata
=========

[](#microdata)

Get microdata from web page !

Install
-------

[](#install)

You can install this lib using [Composer](https://getcomposer.org/) or by cloning this repository.

By using **Composer**, just add following lines into your `composer.json` file and run `composer update`:

```
{
    "require": {
        "malenki/microdata": "dev-master"
    }
}
```

By cloning this repository, just do `git clone https://github.com/malenkiki/microdata.git`.

Coding using the library
------------------------

[](#coding-using-the-library)

With this library, you get microdata as **tree object**.

You can get microdata from given **URL** or given **content as string**:

```
use \Malenki\Microdata;
$md = new Microdata('http://www.some-url.com/path/page.html');
//or
$md = new Microdata($some_content, Microdata::AS_STRING);
var_dump($md->extract());
```

In string context, print the **JSON** microdata tree:

```
use \Malenki\Microdata;
$md = new Microdata('http://www.some-url.com/path/page.html');
print($md);
```

You can get statistical data about amount of types found:

```
use \Malenki\Microdata;
$md = new Microdata('http://www.some-url.com/path/page.html');
var_dump($md->getAllTypeCount());
```

Now, you can **check microdata** with schemas defined on &lt;[www.schema.org](http://www.schema.org)&gt; using their JSON definition type from website or from your own JSON file stored on your file system.

```
use \Malenki\Microdata;
$md = new Microdata('http://www.some-url.com/path/page.html');
$md->availableChecking(); // no arg: it takes JSON from official website
//or
$md->availableChecking('all.json'); // arg: it takes JSON from file system
print($md); // If errors found, they will be present into the returned JSON
```

Using CLI app
-------------

[](#using-cli-app)

This library comes with a small CLI application too.

Its use is simple. If you have not idea how to used it, just do `bin/microdata --help` or read following lines.

To get microdata from an URL, do:

```
$ bin/microdata 'http://some.url/path/'

```

Same as previous but getting JSON in place:

```
$ bin/microdata --json 'http://some.url/path/'

```

You can request checking too (only schemas defined on schema.org):

```
$ bin/microdata --check 'http://some.url/path/'

```

Same as previous but with a JSON schema on local filesystem:

```
$ bin/microdata --check --check-file foo.json 'http://some.url/path/'

```

You can even use pipe or standard input too:

```
$ echo 'Truc' | bin/microdata --pipe

```

Requirements
------------

[](#requirements)

You must have PHP 5.3+ and DOM extension loaded.

Thanks
------

[](#thanks)

This lib is based on work of [Philip Jägenstedt](http://gitorious.org/microdatajs/microdatajs) and [Lin Clark](http://github.com/linclark/MicrodataPHP).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance11

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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

Every ~2 days

Total

2

Last Release

4461d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6af62130bd16d4e6bbaa5877829b6377386ef9fb6593592052dbb6eeb87c4a02?d=identicon)[malenki](/maintainers/malenki)

---

Top Contributors

[![malenkiki](https://avatars.githubusercontent.com/u/195776?v=4)](https://github.com/malenkiki "malenkiki (48 commits)")

---

Tags

jsonwebcheckhtmldomsemanticseomicrodata

### Embed Badge

![Health badge](/badges/malenki-microdata/health.svg)

```
[![Health](https://phpackages.com/badges/malenki-microdata/health.svg)](https://phpackages.com/packages/malenki-microdata)
```

###  Alternatives

[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[paquettg/php-html-parser

An HTML DOM parser. It allows you to manipulate HTML. Find tags on an HTML page with selectors just like jQuery.

2.4k7.9M123](/packages/paquettg-php-html-parser)[sunra/php-simple-html-dom-parser

Composer adaptation of: A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way! Require PHP 5+. Supports invalid HTML. Find tags on an HTML page with selectors just like jQuery. Extract contents from HTML in a single line.

1.3k9.4M61](/packages/sunra-php-simple-html-dom-parser)[simplehtmldom/simplehtmldom

A fast, simple and reliable HTML document parser for PHP.

1921.3M14](/packages/simplehtmldom-simplehtmldom)[scotteh/php-dom-wrapper

Simple DOM wrapper to select nodes using either CSS or XPath expressions and manipulate results quickly and easily.

1471.9M10](/packages/scotteh-php-dom-wrapper)[mf2/mf2

A pure, generic microformats2 parser — makes HTML as easy to consume as a JSON API

200296.9k33](/packages/mf2-mf2)

PHPackages © 2026

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