PHPackages                             matasarei/olx-api-client-v2 - 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. matasarei/olx-api-client-v2

ActiveLibrary[API Development](/categories/api)

matasarei/olx-api-client-v2
===========================

OLX API Client v2

1.2.0(2w ago)748.1k↓49%3MITPHPPHP &gt;=7.4CI passing

Since Jul 12Pushed 2w ago1 watchersCompare

[ Source](https://github.com/matasarei/olx-api-client-v2)[ Packagist](https://packagist.org/packages/matasarei/olx-api-client-v2)[ RSS](/packages/matasarei-olx-api-client-v2/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (5)Dependencies (6)Versions (7)Used By (0)

OLX API Client v2
=================

[](#olx-api-client-v2)

[![CI workflow](https://github.com/matasarei/olx-api-client-v2/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/matasarei/olx-api-client-v2/actions/workflows/tests.yml)[![Latest stable version](https://camo.githubusercontent.com/e63ec755c214eabfc568ecbd49e80700688bba4ae11252a0bb5bd5efe3bb81c3/68747470733a2f2f706f7365722e707567782e6f72672f6d61746173617265692f6f6c782d6170692d636c69656e742d76322f76)](https://packagist.org/packages/matasarei/olx-api-client-v2)[![Total downloads](https://camo.githubusercontent.com/8b79adc3cf75d13d006ea444660aaa12bfbcea8ba1706035aa6bf7d6872f10be/68747470733a2f2f706f7365722e707567782e6f72672f6d61746173617265692f6f6c782d6170692d636c69656e742d76322f646f776e6c6f616473)](https://packagist.org/packages/matasarei/olx-api-client-v2)[![PHP version](https://camo.githubusercontent.com/9e31139d863d7c189fb9c52d58d3f5702984070e39bd7fce0531412317724202/68747470733a2f2f706f7365722e707567782e6f72672f6d61746173617265692f6f6c782d6170692d636c69656e742d76322f726571756972652f706870)](https://packagist.org/packages/matasarei/olx-api-client-v2)[![License](https://camo.githubusercontent.com/8ca1ac27bcd1f28a668a4a18f4ccaebe1c8c0b2c481d3198296f1ef8646f7e3b/68747470733a2f2f706f7365722e707567782e6f72672f6d61746173617265692f6f6c782d6170692d636c69656e742d76322f6c6963656e7365)](LICENSE)

This package implements PHP client for OLX Partner API.

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

[](#requirements)

- PHP 7.4 or newer — CI runs the suite on 7.4, 8.0, 8.1, 8.2, 8.3, 8.4 and 8.5
- [Guzzle](https://docs.guzzlephp.org/) 7 or 8 — either works, and both are covered by CI
- `ext-json`

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

[](#installation)

To install the package to your project via [Composer](http://getcomposer.org/) simply run:

```
composer require matasarei/olx-api-client-v2
```

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

[](#documentation)

Official OLX API documentation and developers portal:

- [Bulgaria](https://developer.olx.bg/api/doc)
- [Kazakhstan](https://developer.olx.kz/api/doc)
- [Poland](https://developer.olx.pl/api/doc)
- [Portugal](https://developer.olx.pt/api/doc)
- [Romania](https://developer.olx.ro/api/doc)
- [Ukraine](https://developer.olx.ua/api/doc)

Check the troubleshooting section if you have any issues.

Usage
-----

[](#usage)

### Basic Example

[](#basic-example)

```
use Gentor\Olx\Api\Client;
use Gentor\Olx\Api\Credentials;

$credentials = new Credentials('your_client_id', 'your_client_secret');
$client = new Client($credentials, Client::OLX_UA);

// Create an advert
$response = $client->adverts()->create([
    'title' => 'My Product',
    'description' => 'Product description...',
    'category_id' => 123,
    // ... other required fields
]);

// Access the created advert data
$advertData = $response['data'];
echo "Created advert ID: " . $advertData['id'];
echo "Status: " . $advertData['status'];
```

### Important: API Response Format

[](#important-api-response-format)

All OLX API responses wrap the actual data in a `data` key according to the official API specification:

```
// What you get from the API:
[
  'data' => [
    'id' => 905890605,
    'status' => 'active',
    // ... other advert fields
  ]
]

// Access the actual data:
$response = $client->adverts()->create($request);
$advertData = $response['data'];
```

This response format applies to advert-related endpoints, for example:

- `GET /adverts` returns `['data' => [array of adverts]]`
- `POST /adverts` returns `['data' => {advert object}]`
- `GET /adverts/{id}` returns `['data' => {advert object}]`
- `PUT /adverts/{id}` returns `['data' => {advert object}]`

Other endpoints may have different response structures. Please refer to the official OLX API documentation for details on the response format of each endpoint.

Testing and development
-----------------------

[](#testing-and-development)

The commands below run through Docker, so no local PHP install is needed.

Use the `composer:2` image rather than `composer:lts`. The LTS image ships Composer 2.2, which predates security-advisory checking — it installs dependencies with known vulnerabilities without saying a word, which is how [\#9](https://github.com/matasarei/olx-api-client-v2/issues/9) went unnoticed locally while consumers could not install the package at all.

1. Install vendors

```
docker run --rm -v $(pwd):/app -w /app composer:2 composer update
```

2. Run tests

```
docker run --rm -v $(pwd):/app -w /app composer:2 vendor/bin/phpunit
```

3. Check for vulnerable dependencies

```
docker run --rm -v $(pwd):/app -w /app composer:2 composer audit --no-dev
```

### Reproducing the CI dependency matrix

[](#reproducing-the-ci-dependency-matrix)

`composer update` on its own only ever resolves the newest allowed versions, which for `^7.4 || ^8.0` always means Guzzle 8. CI additionally proves the floor of every constraint and the Guzzle 7 path, and you can run either locally:

```
# Floor of every constraint (currently Guzzle 7.15.1 + psr7 2.13.0)
docker run --rm -v $(pwd):/app -w /app composer:2 composer update --prefer-lowest --prefer-stable

# The Guzzle 7 half of the constraint
docker run --rm -v $(pwd):/app -w /app composer:2 \
  composer update --with "guzzlehttp/guzzle:^7.15" --with "guzzlehttp/psr7:^2.13"
```

Note that `composer update` is used throughout rather than `composer install`: only re-resolving applies Composer's security-advisory policy, so a dependency that has gone vulnerable fails loudly instead of silently installing.

### Testing against a specific PHP version

[](#testing-against-a-specific-php-version)

Dependencies have to be resolved *for* the target version, otherwise Composer picks packages requiring a newer PHP and the suite dies on a syntax error rather than a real failure. Pin the platform, run the suite, then restore `composer.json`:

```
docker run --rm -v $(pwd):/app -w /app composer:2 composer config platform.php 7.4.33
docker run --rm -v $(pwd):/app -w /app composer:2 composer update
docker run --rm -v $(pwd):/app -w /app php:7.4-cli php vendor/bin/phpunit
git checkout composer.json   # drops the temporary platform pin
```

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance96

Actively maintained with recent releases

Popularity37

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.5% 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 ~187 days

Total

5

Last Release

19d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/44632227efd38dd8598ceb71812e223865e994f1f35f027b423469133fb29d6b?d=identicon)[matasarei](/maintainers/matasarei)

---

Top Contributors

[![matasarei](https://avatars.githubusercontent.com/u/6638367?v=4)](https://github.com/matasarei "matasarei (13 commits)")[![gentor](https://avatars.githubusercontent.com/u/2902504?v=4)](https://github.com/gentor "gentor (2 commits)")[![google-labs-jules[bot]](https://avatars.githubusercontent.com/in/842251?v=4)](https://github.com/google-labs-jules[bot] "google-labs-jules[bot] (1 commits)")[![serhiymaystro](https://avatars.githubusercontent.com/u/13778243?v=4)](https://github.com/serhiymaystro "serhiymaystro (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/matasarei-olx-api-client-v2/health.svg)

```
[![Health](https://phpackages.com/badges/matasarei-olx-api-client-v2/health.svg)](https://phpackages.com/packages/matasarei-olx-api-client-v2)
```

###  Alternatives

[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

353.6k](/packages/eslazarev-wildberries-sdk)[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k555.0M2.8k](/packages/aws-aws-sdk-php)[sylius/sylius

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

8.5k6.0M778](/packages/sylius-sylius)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19467.3M1.9k](/packages/drupal-core)[theodo-group/llphant

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

1.7k441.1k8](/packages/theodo-group-llphant)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

762297.9k53](/packages/civicrm-civicrm-core)

PHPackages © 2026

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