PHPackages                             peekmo/jsonpath - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. peekmo/jsonpath

AbandonedArchivedProject[Utility &amp; Helpers](/categories/utility)

peekmo/jsonpath
===============

Library to use JsonPath

1.1.0(12y ago)742.6M—5.2%22[4 issues](https://github.com/Peekmo/JsonPath/issues)[2 PRs](https://github.com/Peekmo/JsonPath/pulls)10MITPHPPHP &gt;=5.3.3

Since Oct 26Pushed 8y ago9 watchersCompare

[ Source](https://github.com/Peekmo/JsonPath)[ Packagist](https://packagist.org/packages/peekmo/jsonpath)[ Docs](https://github.com/Peekmo/JsonPath)[ RSS](/packages/peekmo-jsonpath/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (6)Used By (10)

JsonPath
========

[](#jsonpath)

[![Bitdeli Badge](https://camo.githubusercontent.com/23c85fdb1465cc0fca43c3e0ba8831633601da2a31ddb88b820098e30bc08034/68747470733a2f2f64327765637a68766c38323376302e636c6f756466726f6e742e6e65742f5065656b6d6f2f6a736f6e706174682f7472656e642e706e67)](https://bitdeli.com/free "Bitdeli Badge")

JsonPath utility (XPath for JSON) for PHP based on **Stefan Goessner's** implementation :

C php extension is in progress [here](https://github.com/Peekmo/php-ext-jsonpath), any help is welcome :)

Documentation
-------------

[](#documentation)

What is JsonPath ? What is the syntax ? Take a look to [Stefan Goessner's documentation](http://goessner.net/articles/JsonPath/)

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

[](#installation)

- That's simple ! Add this to your composer.json :

```
    "require": {
        "peekmo/jsonpath": "dev-master"
    }

```

You just have to require the vendor/autoload.php (if not already) and add the following use :

```
    use Peekmo\JsonPath\JsonStore;
```

How it works ?
--------------

[](#how-it-works-)

/!\\ API Breaking Changes with new version !

Consider this json :

```
{
    "store": {
        "book": [
            {
                "category": "reference",
                "author": "Nigel Rees",
                "title": "Sayings of the Century",
                "price": 8.95
            },
            {
                "category": "fiction",
                "author": "Evelyn Waugh",
                "title": "Sword of Honour",
                "price": 12.99
            },
            {
                "category": "fiction",
                "author": "Herman Melville",
                "title": "Moby Dick",
                "isbn": "0-553-21311-3",
                "price": 8.99
            },
            {
                "category": "fiction",
                "author": "J. R. R. Tolkien",
                "title": "The Lord of the Rings",
                "isbn": "0-395-19395-8",
                "price": 22.99
            }
        ],
        "bicycle": {
            "color": "red",
            "price": 19.95
        }
    }
}

```

- Transform your json into **array** (it works with object, but use an array for better performances)
- You can get values like this :

```

```

It returns an array, you can so use default [functions](http://php.net/manual/fr/ref.array.php) on the result (Have unique key for example) From 1.1.0, it returns an empty array if the node does not exists

- You can change a value like this :

```

```

The parameter "key" is optional, a number will be set if you're not providing one. It returns a boolean to know if the node has been modified or not

- You can remove an attribute like this :

```

```

Thanks
------

[](#thanks)

- Special thanks to **Stefan Goessner** for his previous work

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity56

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 81.3% 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 ~52 days

Total

4

Last Release

4262d ago

Major Versions

1.1.0 → 2.x-dev2014-09-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/f94b6659e1158b1ac788a8b0c3adcc9ddb13aeac1842ee1a974dc6678a9c6274?d=identicon)[Peekmo](/maintainers/Peekmo)

---

Top Contributors

[![Peekmo](https://avatars.githubusercontent.com/u/3881523?v=4)](https://github.com/Peekmo "Peekmo (26 commits)")[![martinec](https://avatars.githubusercontent.com/u/800627?v=4)](https://github.com/martinec "martinec (3 commits)")[![gilo-agilo](https://avatars.githubusercontent.com/u/7155996?v=4)](https://github.com/gilo-agilo "gilo-agilo (2 commits)")[![adrienrn](https://avatars.githubusercontent.com/u/5598481?v=4)](https://github.com/adrienrn "adrienrn (1 commits)")

### Embed Badge

![Health badge](/badges/peekmo-jsonpath/health.svg)

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

PHPackages © 2026

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