PHPackages                             asocial-media/allegro-api - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. asocial-media/allegro-api

ActiveLibrary[HTTP &amp; Networking](/categories/http)

asocial-media/allegro-api
=========================

The PHP Interface for Allegro RestAPI and Allegro WebAPI

3.1.0(6y ago)98.0k↓25%12[3 PRs](https://github.com/asocial-media/allegro-api/pulls)MITPHPPHP &gt;=5.2.4

Since Jun 6Pushed 2y ago3 watchersCompare

[ Source](https://github.com/asocial-media/allegro-api)[ Packagist](https://packagist.org/packages/asocial-media/allegro-api)[ Docs](https://asocial.media)[ RSS](/packages/asocial-media-allegro-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (15)Used By (0)

README
======

[](#readme)

The PHP interface which allows you to communicate with **Allegro WebAPI and RestApi**

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

[](#requirements)

- PHP &gt;= 5.2.4

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

[](#installation)

### Composer (recommended)

[](#composer-recommended)

```
$ composer require asocial-media/allegro-api
```

### Manually

[](#manually)

```
$ git clone https://github.com/asocial-media/allegro-api.git
```

or just [download zip archive](https://github.com/asocial-media/allegro-api/archive/master.zip)

Basic usage of Allegro RestApi
------------------------------

[](#basic-usage-of-allegro-restapi)

```
// Used namespace
use AsocialMedia\AllegroApi\AllegroRestApi;

// Register your application here:
// https://apps.developer.allegro.pl

// Creating auth URL using client id and redirect_uri
var_dump(
    AllegroRestApi::getAuthLink($clientId, $redirectUri)
);

// After clicking above link you need to grant permission and then
// you will be redirected to:
//     $redirectUri with special code in URL (GET)
//
// Use above code to finally generate your access token
$tokens = AllegroRestApi::generateToken(
    (isset($_GET['code']) ? $_GET['code'] : null),
    $clientId,
    $clientSecret,
    $redirectUri
);

// Token will be active for 12 hours and you can refresh
// it indefinitely (via cron job)
AllegroRestApi::refreshToken(
    $tokens->refresh_token,
    $clientId,
    $clientSecret,
    $redirectUri
);

// If we have our access token we can finally request REST API

// Creating an instance of RestApi
$restApi = new AllegroRestApi($tokens->access_token);

// Getting our comments
$response = $restApi->get('/sale/user-ratings?user.id=' . $yourUserId);

// Creating 2 variants using color/pattern
$response = $restApi->put('/sale/offer-variants/' . $restApi->getUuid(), array(
    'name'       => 'Wariant 1',
    'offers'     => array(
        array(
            'id'           => '6846772956',
            'colorPattern' => 'yellow_gold'
        ),
        array(
            'id'           => '6846772915',
            'colorPattern' => 'white_rhodium'
        )
    ),
    'parameters' => array(
        array(
            'id' => 'color/pattern'
        ),
    )
), array(
    'Content-Type' => 'application/vnd.allegro.beta.v1+json', // Some actions needs version change from "public" to "beta"
    'Accept'       => 'application/vnd.allegro.beta.v1+json', // Some actions needs version change from "public" to "beta"
));
```

Basic usage of Allegro WebApi
-----------------------------

[](#basic-usage-of-allegro-webapi)

```
// Used namespace
use AsocialMedia\AllegroApi\AllegroApi;

// Creating new instance of AllegroApi
$api = new AllegroApi('your_api_key');

// We are going to login using Allegro WebApi
$api->login(array(
    'userLogin'    => 'example',
    'userPassword' => 'examplepass',
    'countryCode'  => $api->getCountry(),
    'webapiKey'    => $api->getApiKey(),
    'localVersion' => $api->getVersionKey(),
));
// For now, we have an access to $api->getSession()

// Getting our current black list using Allegro WebApi
$response = $api->doGetBlackListUsers(array(
    'sessionHandle' => $api->getSession(),
));

// We can also omit "do" prefix in method names
$response = $api->getBlackListUsers(array(
    'sessionHandle' => $api->getSession(),
));
```

Authors
-------

[](#authors)

- Maciej Strączkowski -

License
-------

[](#license)

The files in this archive are released under the [MIT LICENSE](LICENSE).

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 62.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 ~114 days

Recently: every ~89 days

Total

13

Last Release

2264d ago

Major Versions

1.0.3 → 2.0.02018-06-19

2.0.5 → 3.0.02019-03-26

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1781892?v=4)[Maciej Strączkowski](/maintainers/mstraczkowski)[@mstraczkowski](https://github.com/mstraczkowski)

---

Top Contributors

[![mstraczkowski](https://avatars.githubusercontent.com/u/1781892?v=4)](https://github.com/mstraczkowski "mstraczkowski (5 commits)")[![vt-parhomenko](https://avatars.githubusercontent.com/u/15807120?v=4)](https://github.com/vt-parhomenko "vt-parhomenko (3 commits)")

---

Tags

allegroapiphpwebapiapirestwebapiallegro

### Embed Badge

![Health badge](/badges/asocial-media-allegro-api/health.svg)

```
[![Health](https://phpackages.com/badges/asocial-media-allegro-api/health.svg)](https://phpackages.com/packages/asocial-media-allegro-api)
```

###  Alternatives

[xendit/xendit-php

Xendit PHP SDK

189730.6k6](/packages/xendit-xendit-php)[angelleye/paypal-php-library

PHP wrapper for PayPal APIs

243440.9k](/packages/angelleye-paypal-php-library)[infobip/infobip-api-php-client

PHP library for consuming Infobip's API

921.8M10](/packages/infobip-infobip-api-php-client)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)[mediamonks/rest-api-bundle

MediaMonks Rest API Symfony Bundle

1656.2k1](/packages/mediamonks-rest-api-bundle)[phrest/api

REST API Package for Phalcon PHP

304.2k](/packages/phrest-api)

PHPackages © 2026

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