PHPackages                             astronati/wordpress-api-response-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. astronati/wordpress-api-response-parser

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

astronati/wordpress-api-response-parser
=======================================

Allows to map responses provided by any Wordpress API.

2.1.0(3y ago)53.8k1[1 issues](https://github.com/astronati/php-wordpress-api-response-parser/issues)MITPHPPHP &gt;=7.4CI failing

Since May 7Pushed 3y ago1 watchersCompare

[ Source](https://github.com/astronati/php-wordpress-api-response-parser)[ Packagist](https://packagist.org/packages/astronati/wordpress-api-response-parser)[ RSS](/packages/astronati-wordpress-api-response-parser/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (5)Versions (18)Used By (0)

[![Build Status](https://camo.githubusercontent.com/75c40cd7d3983da1e384ae0a172752ecd2889d0679d29389cc71a7a28bbc7a44/68747470733a2f2f7472617669732d63692e6f72672f617374726f6e6174692f7068702d776f726470726573732d6170692d726573706f6e73652d7061727365722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/astronati/php-sports-open-data-response-parser)[![Codacy Badge](https://camo.githubusercontent.com/4b8bdeb4feef9cc36a12974eee80e42ed02d9ce569f01f3214dd540d18f899f2/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6233396464623439336633383439356462663063376435393336366563643733)](https://www.codacy.com/app/astronati/php-wordpress-api-response-parser?utm_source=github.com&utm_medium=referral&utm_content=astronati/php-wordpress-api-response-parser&utm_campaign=Badge_Grade)[![Codacy Badge](https://camo.githubusercontent.com/c7e9800fc83b2c7b08f52073a6f56247b97eb476d473df56e2995cd274b63be0/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f6233396464623439336633383439356462663063376435393336366563643733)](https://www.codacy.com/app/astronati/php-wordpress-api-response-parser?utm_source=github.com&utm_medium=referral&utm_content=astronati/php-wordpress-api-response-parser&utm_campaign=Badge_Coverage)[![Latest Stable Version](https://camo.githubusercontent.com/92a9dd6d189af1da36a1b3d68f4214ca9dcbb6de6a601343b643f090bd1a24fa/68747470733a2f2f706f7365722e707567782e6f72672f617374726f6e6174692f776f726470726573732d6170692d726573706f6e73652d7061727365722f762f737461626c65)](https://packagist.org/packages/astronati/wordpress-api-response-parser)[![License](https://camo.githubusercontent.com/8d8222872222bc8eb3247efdfa26188af07213b308ed26752dc5feb29239d66e/68747470733a2f2f706f7365722e707567782e6f72672f617374726f6e6174692f776f726470726573732d6170692d726573706f6e73652d7061727365722f6c6963656e7365)](https://packagist.org/packages/astronati/wordpress-api-response-parser)

Wordpress API Response Parser
=============================

[](#wordpress-api-response-parser)

Allows to map responses provided by Wordpress API.

Supported Responses
-------------------

[](#supported-responses)

Not all responses are currently supported but we are happy to work for you if you need some of them.

**NOTE:** To add another response into the supported list, please file a new issue.

To do that please file a new [issue](https://github.com/astronati/php-wordpress-api-response-parser/issues/new).

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

[](#installation)

You can install the library and its dependencies using `composer` running:

```
$ composer require astronati/wordpress-api-response-parser
```

### Usage

[](#usage)

The library allows to return a model per each response and its content (post, tag, category, etc...).

##### Example

[](#example)

The following snippet can be helpful:

```
use WARP\Response\ResponseParser;
...
// Obtain a Response
$apiResponse = ['id' => 123, ...] // Save the response from a Wordpress API
$response = ResponseParser::create($apiResponse, ResponseParser::CREATE_POST);
...
// Get post
$post = $response->getPost();
echo $post->getID(); // 123
```

For more details please take a look at [Response](https://github.com/astronati/php-wordpress-api-response-parser/tree/master/src/Response).

Development
-----------

[](#development)

The environment requires [phpunit](https://phpunit.de/), that has been already included in the `dev-dependencies` of the `composer.json`.

### Dependencies

[](#dependencies)

To install all modules you just need to run following command:

```
$ composer install
```

### Testing

[](#testing)

Tests files are created in dedicates folders that replicate the [src](https://github.com/astronati/php-wordpress-api-response-parser/tree/master/src) structure as follows:

```
.
+-- src
|   +-- [folder-name]
|   |   +-- [file-name].php
|   ...
+-- tests
|   +-- [folder-name]
|   |   +-- [file-name]Test.php

```

Execute following command to run the tests suite:

```
$ composer test
```

Run what follows to see the code coverage:

```
$ composer coverage
```

License
-------

[](#license)

This package is released under the [MIT license](LICENSE.md).

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity72

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 ~109 days

Recently: every ~174 days

Total

16

Last Release

1293d ago

Major Versions

1.8.1 → 2.0.02021-10-07

PHP version history (4 changes)1.0.0PHP &gt;=7.1.0

1.7.0PHP &gt;=7.2.5

2.0.0PHP &gt;=7.4.12

2.0.1PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/2d2221aad4b4045aea529521b9879f8980ff7798239b23e5bc10c0f2a09f8260?d=identicon)[Andrea Stronati](/maintainers/Andrea%20Stronati)

---

Top Contributors

[![astronati](https://avatars.githubusercontent.com/u/2708431?v=4)](https://github.com/astronati "astronati (8 commits)")

---

Tags

php7wordpresswordpress-apiwordpress-php-librarywp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/astronati-wordpress-api-response-parser/health.svg)

```
[![Health](https://phpackages.com/badges/astronati-wordpress-api-response-parser/health.svg)](https://phpackages.com/packages/astronati-wordpress-api-response-parser)
```

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

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

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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