PHPackages                             sspat/profiru - 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. sspat/profiru

AbandonedLibrary[API Development](/categories/api)

sspat/profiru
=============

Profi.ru partership program API client

2.0.0(7y ago)320MITPHPPHP &gt;=7.3.0CI failing

Since Aug 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/sspat/profiru)[ Packagist](https://packagist.org/packages/sspat/profiru)[ RSS](/packages/sspat-profiru/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (6)Versions (13)Used By (0)

Profi.ru partership program API client
======================================

[](#profiru-partership-program-api-client)

[![Author](https://camo.githubusercontent.com/2e7ca2bfc97137f1af3856460dd8d4cc962e84ef4af176cc8d0ff9a22b07dd3d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d4073737061742d626c75652e7376673f7374796c653d666c61742d737175617265)](https://moikrug.ru/sspat)![GitHub tag](https://camo.githubusercontent.com/123158181962de00ebda6aa212fc26b4c17b7fc5be7032e48cfc4f0d016a2be9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f73737061742f70726f666972752e737667)[![license](https://camo.githubusercontent.com/850eae1099d2b05f53383473d7cd51f9bc1ab09b7d0d9e5122f1dd930efdcc6d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6173686170652f6170697374617475732e737667)](https://github.com/sspat/profiru/blob/master/LICENSE)

Features
--------

[](#features)

This package provides easy access to the [Profi.ru partnership program API](https://reg.profi.ru/partner/).

After registering on the program and receiving your SSL certificate and key you can use the API right away.

Currently implemented in the package are the `dictionary` and `pagination` API's. The `provisioning` API will be implemented in future releases.

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

[](#requirements)

- The minimum required PHP version is PHP 7.3.0.
- You will need an SSL certificate and public key provided by the Profi.ru partnership program representatives to get access to the API

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
composer require sspat/profiru

```

or add

```
"sspat/profiru": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

**Sending requests to the API**

```
use GuzzleHttp\RequestOptions;
use Http\Adapter\Guzzle6\Client as GuzzleAdapter;
use sspat\ProfiRu\Client;
use sspat\ProfiRu\Constants\Domains;

// Create an instance of any PSR-18 compliant HTTP Client and pass your partnership SSL certificate and key paths
$httpClient = GuzzleAdapter::createWithConfig([
    RequestOptions::TIMEOUT => 5,
    RequestOptions::SSL_KEY => 'partner.key',
    RequestOptions::CERT => 'partner.crt',
    RequestOptions::VERIFY => false,
]);
// Create an instance of the API client, passing the HTTP client to it
$api = new Client($httpClient);

// Get Locations dictionary
$locations = $api->getLocations();
// Get Services dictionary
$services = $api->getServices();

// For requests to the pagination API an API domain must be specified
$organizations = $api->getOrganizations(Domains::HEALTHCARE);
$specialists = $api->getSpecialists(Domains::BEAUTY);
```

Requests to the `pagination` API require choosing an API domain and can be further configured with a second argument.

```
$organizations = $api->getOrganizations(
    Domains::HEALTHCARE,
    [
         'city'   => Cities::MOSCOW,
         'from'   => 220,
         'count'  => 10,
         'scope'  => Scopes::SCOPE_FULL,
         'ip'     => '144.135.23.1',
         'models' => [
             Models::ASSOCIATION,
             Models::ASSOCIATION_STRUCTURE_UNIT
         ]
    ]
);
```

Supported domains for the `pagination` API

DomainDescriptionSupported citiesdktrHealthcaremsk, spbkrstBeautymsk, spbSupported additional parameters for the `pagination` API

ParameterDescriptionDefaultPossible valuesConstant classcityThe pagination API can return entries only for a single city at once. Different domains support different sets of cities. Moscow is supported by all domains, so it is the default value.mskDepends on domain[\\sspat\\ProfiRu\\Constants\\Cities](https://github.com/sspat/profiru/blob/master/src/Constants/Cities.php)fromUsed for skipping a number of entries for pagination0Positive integerscountNumber of entries per page201-20scopeDefines the ammount of data retrieved for each entryprofile.miniprofile.mini, profile.full[\\sspat\\ProfiRu\\Constants\\Scopes](https://github.com/sspat/profiru/blob/master/src/Constants/Scopes.php)ipIP address of the API client127.0.0.1IPv4/IPv6 addressmodelsTypes of entries to get from the APIDepends on whether you request organizations or specialistsDepends on whether you request organizations or specialists[\\sspat\\ProfiRu\\Constants\\Models](https://github.com/sspat/profiru/blob/master/src/Constants/Models.php)Getting the response
--------------------

[](#getting-the-response)

The client returns response objects that already contain the API response in form of an array. You can also retrieve the PSR-7 response object if you need additional response data.

```
// Get Locations dictionary
$locations = $api->getLocations();
// Get response body as Array
$locationsArray = $locations->asArray();
// Get PSR-7 response object
$psrResponse = $locations->response();
var_dump((string) $psrResponse->getBody());
```

Handling errors
---------------

[](#handling-errors)

The response object processes all errors returned by the API and raises them in form of an exception.

```
use sspat\ProfiRu\Exceptions\ErrorResponse;

try {
    $services = $api->getServices();
} catch (ErrorResponse $e) {
    var_dump($e->getErrors());
}
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

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

Recently: every ~118 days

Total

11

Last Release

2706d ago

Major Versions

1.2.5 → 2.0.02018-12-17

PHP version history (3 changes)1.0.2PHP &gt;=5.3.0

1.1.1PHP &gt;=5.4.0

2.0.0PHP &gt;=7.3.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f762f20ec3d91c4c4c0ae56424e38c8658076ada202c68e1acfde68b5476050?d=identicon)[sspat](/maintainers/sspat)

---

Top Contributors

[![sspat](https://avatars.githubusercontent.com/u/5153242?v=4)](https://github.com/sspat "sspat (26 commits)")

---

Tags

profi.ruprofi apiprofi.ru api

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sspat-profiru/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[algolia/algoliasearch-client-php

API powering the features of Algolia.

69333.0M114](/packages/algolia-algoliasearch-client-php)[vin-sw/shopware-sdk

A PHP SDK for Shopware 6 Platform

122469.3k6](/packages/vin-sw-shopware-sdk)[yoti/yoti-php-sdk

Yoti SDK for quickly integrating your PHP backend with Yoti

27539.9k1](/packages/yoti-yoti-php-sdk)[commercetools/commercetools-sdk

The official PHP SDK for the commercetools Composable Commerce APIs

19281.5k](/packages/commercetools-commercetools-sdk)

PHPackages © 2026

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