PHPackages                             codeies/json-query - 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. codeies/json-query

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

codeies/json-query
==================

PHP class for performing MySQL-like queries on JSON data.

v1.0.0(2y ago)07MITPHPPHP ^7.4

Since Mar 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/codeies/JsonQuery)[ Packagist](https://packagist.org/packages/codeies/json-query)[ RSS](/packages/codeies-json-query/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)DependenciesVersions (2)Used By (0)

JsonQuery
=========

[](#jsonquery)

JsonQuery is a PHP class that allows you to perform operations similar to MySQL queries on JSON data, including searching, sorting, and pagination.

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

[](#installation)

You can install JsonQuery via Composer by adding it as a dependency to your `composer.json` file:

```
composer require codeies/json-query
```

Usage
-----

[](#usage)

```
require_once 'vendor/autoload.php';

use Codeies\JsonQuery\JsonQuery;

// Create a new instance of JsonQuery
$jsonQuery = new JsonQuery('path/to/your/data.json');

// Find method
$results = $jsonQuery->find('searchValue')
                    ->sort('category', 'desc')
                    ->paginate($page, $perPage)
                    ->getData();
```

Methods
-------

[](#methods)

```
find($value)
Searches for the specified value within the JSON data.

sort($key, $order = 'asc')
Sorts the filtered data by the specified key and order.

paginate($page, $perPage)
Paginates the filtered data based on the specified page number and items per page.

getData()
Returns the filtered and paginated data.
```

```
[
    {"id": 1, "name": "Product 1", "category": "Category A", "price": 10.99},
    {"id": 2, "name": "Product 2", "category": "Category B", "price": 20.99},
    ...
]
```

License
-------

[](#license)

This project is licensed under the MIT License - see the LICENSE file for details. Make sure to replace `'path/to/your/data.json'` with the actual path to your JSON data file and update any placeholders with your actual project details.

This `README.md` file provides a brief overview of your package, instructions on how to install it using Composer, a usage example, details about the methods available, an example data format, and information about the license.

// Output results
-----------------

[](#-output-results)

print\_r($results);

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

828d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/69535487?v=4)[Muhammad Junaid](/maintainers/codeies)[@codeies](https://github.com/codeies)

---

Top Contributors

[![codeies](https://avatars.githubusercontent.com/u/69535487?v=4)](https://github.com/codeies "codeies (17 commits)")

### Embed Badge

![Health badge](/badges/codeies-json-query/health.svg)

```
[![Health](https://phpackages.com/badges/codeies-json-query/health.svg)](https://phpackages.com/packages/codeies-json-query)
```

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M47](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

45153.1k6](/packages/jstewmc-rtf)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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