PHPackages                             oxcom/magento2-top-products - 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. [API Development](/categories/api)
4. /
5. oxcom/magento2-top-products

ActiveMagento2-module[API Development](/categories/api)

oxcom/magento2-top-products
===========================

This is a module that extends Magento2 API to get list of TOP products.

1.2.0(4w ago)73595LGPL-3.0PHPPHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0CI passing

Since Oct 25Pushed 4w ago3 watchersCompare

[ Source](https://github.com/OxCom/magento2-top-products)[ Packagist](https://packagist.org/packages/oxcom/magento2-top-products)[ Docs](https://github.com/OxCom/magento2-top-products)[ RSS](/packages/oxcom-magento2-top-products/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (9)Dependencies (21)Versions (10)Used By (0)

Magento2 Top Products API
=========================

[](#magento2-top-products-api)

[![CI](https://github.com/OxCom/magento2-top-products/actions/workflows/ci.yml/badge.svg)](https://github.com/OxCom/magento2-top-products/actions/workflows/ci.yml)

This is a module that extends Magento2 API to get list of TOP products by next filters:

- TOP selling products
- TOP Free products
- TOP Rated products

Top selling and free products are fetching from Magento2 reports.

Top rated products are fetching from Rates module and results are based on aggregated data.

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

[](#requirements)

- PHP 8.2, 8.3, 8.4 or 8.5
- Magento 2.4.6+ (magento/framework ^103.0)

Install
-------

[](#install)

```
$ composer require oxcom/magento2-top-products
$ bin/magento module:enable OxCom_MagentoTopProducts
$ bin/magento setup:upgrade
$ bin/magento setup:di:compile
```

API requests
------------

[](#api-requests)

`GET /V1/products/top/{type}` - Get list of top products by type. Where `type` can be:

- **selling** - TOP selling products
- **free** - TOP Free products
- **rated** - TOP Rated products

###### Search criteria params

[](#search-criteria-params)

**pageSize** - Page size

**currentPage** - Current page

**ratingCode** - filter by rating type. This options is related ony for `rated` type. Possible values can be found in `rating` table.

**period** - filter by period. This options is related only for `selling` or `free` type. Possible values are:

- yearly - annual report (default)
- monthly - monthly report
- daily - daily report

**filter\_groups** - As product search criteria this filter will allow you to process products collection with more requirements.

###### Search criteria examples:

[](#search-criteria-examples)

Filter top selling products by:

- period: daily
- price &gt; 10
- visibility = 4
- pageSize = 10
- currentPage = 2

```
$ curl -X GET \
  'https://example.com/rest/all/V1/products/top/selling?searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bfield%5D=visibility&searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bvalue%5D=4&searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bcondition_type%5D=eq&searchCriteria%5BpageSize%5D=10&searchCriteria%5BcurrentPage%5D=2&searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B1%5D%5Bfield%5D=price&searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B1%5D%5Bvalue%5D=10&searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B1%5D%5Bcondition_type%5D=gt&searchCriteria%5Bperiod%5D=daily' \
  -H 'authorization: Bearer {api-token}' \
  -H 'cache-control: no-cache'
```

Filter top rated products by:

- ratingCode: Rating
- status = 2
- visibility = 4
- pageSize = 10
- currentPage = 2

```
$ curl -X GET \
  'https://example.com/rest/all/V1/products/top/rated?searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bfield%5D=visibility&searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bvalue%5D=4&searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bcondition_type%5D=eq&searchCriteria%5BpageSize%5D=10&searchCriteria%5BcurrentPage%5D=2&searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B1%5D%5Bfield%5D=status&searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B1%5D%5Bvalue%5D=1&searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B1%5D%5Bcondition_type%5D=eq&searchCriteria%5BratingCode%5D=Rating' \
  -H 'authorization: Bearer {api-token}' \
  -H 'cache-control: no-cache'
```

Dependencies
------------

[](#dependencies)

This module is using exists functionality of next modules:

- **magento/module-catalog**
- **magento/module-review**
- **magento/module-sales**

Bugs and Issues
---------------

[](#bugs-and-issues)

Please, if You found a bug or something, that is not working properly, contact me and tell what's wrong. It's nice to have an example how to reproduce a bug, or any idea how to fix it in Your request. I'll take care about it ASAP.

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance94

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity86

Battle-tested with a long release history

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

Recently: every ~717 days

Total

8

Last Release

29d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.6

1.2.0PHP ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4608564?v=4)[Andrey](/maintainers/OxCom)[@OxCom](https://github.com/OxCom)

---

Top Contributors

[![OxCom](https://avatars.githubusercontent.com/u/4608564?v=4)](https://github.com/OxCom "OxCom (13 commits)")

---

Tags

apimagento2magento2-moduleproducts-marketapimagento2top products

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/oxcom-magento2-top-products/health.svg)

```
[![Health](https://phpackages.com/badges/oxcom-magento2-top-products/health.svg)](https://phpackages.com/packages/oxcom-magento2-top-products)
```

###  Alternatives

[mollie/magento2

Mollie Payment Module for Magento 2

1142.0M17](/packages/mollie-magento2)[buckaroo/magento2

Buckaroo Magento 2 extension

32426.0k8](/packages/buckaroo-magento2)[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

69362.0k](/packages/run-as-root-magento2-prometheus-exporter)[dotdigital/dotdigital-magento2-extension

Dotdigital for Magento 2

50406.2k23](/packages/dotdigital-dotdigital-magento2-extension)[loki/magento2-components

Core module for defining Alpine.js components with advanced AJAX features

1015.1k29](/packages/loki-magento2-components)[loki/magento2-admin-components

Admin Panel grids and forms created via Loki Components

178.3k9](/packages/loki-magento2-admin-components)

PHPackages © 2026

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