{"id":36995028,"url":"https://github.com/ircykk/allegro-api","last_synced_at":"2026-01-13T23:47:19.815Z","repository":{"id":56993395,"uuid":"130860389","full_name":"ircykk/allegro-api","owner":"ircykk","description":" A simple Allegro API client library.","archived":false,"fork":false,"pushed_at":"2024-12-21T13:34:21.000Z","size":217,"stargazers_count":11,"open_issues_count":3,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-11-27T15:12:48.628Z","etag":null,"topics":["allegro","allegro-api","httplug","php","rest","soap"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ircykk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-24T13:41:06.000Z","updated_at":"2025-02-07T23:04:52.000Z","dependencies_parsed_at":"2022-08-21T12:50:57.156Z","dependency_job_id":null,"html_url":"https://github.com/ircykk/allegro-api","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/ircykk/allegro-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ircykk%2Fallegro-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ircykk%2Fallegro-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ircykk%2Fallegro-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ircykk%2Fallegro-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ircykk","download_url":"https://codeload.github.com/ircykk/allegro-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ircykk%2Fallegro-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28405307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["allegro","allegro-api","httplug","php","rest","soap"],"created_at":"2026-01-13T23:47:19.720Z","updated_at":"2026-01-13T23:47:19.795Z","avatar_url":"https://github.com/ircykk.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Allegro API\n\nAllegro API client library, written with PHP.\n\n## Requirements\n* PHP \u003e= 5.6 || PHP \u003e= 7.0\n* HTTP client\n\n## Features\n* REST and SOAP WebApi\n* Sandbox support\n* Auto-complete\n* PSR compatible\n\n## Installation\n\nVia Composer:\n\n```bash\ncomposer require ircykk/allegro-api\n```\n\nLibrary is build on top of [HTTPlug](http://httplug.io/), we need to install HTTP client.\n\n```bash\ncomposer require php-http/guzzle6-adapter \"^1.1\"\n```\n\n## Developer Documentation\nhttps://developer.allegro.pl/documentation/\n\n## Usage of client\n\n### Authentication with OAuth\n\n```php\n\u003c?php\n\n// Composer autoload\nrequire_once __DIR__.'/vendor/autoload.php';\n\n$credentials = ...\n\n$client = new \\Ircykk\\AllegroApi\\Client($credentials);\n\n// Redirect to allegro for authenticate and get back with code\nif (!isset($_GET['code'])) {\n    header('Location: '.$client-\u003egetAuthUrl());\n} else {\n    $token = $client-\u003efetchAccessTokenWithAuthCode($_GET['code']);\n\n    // Store access token...\n}\n```\n\nWe have `$token-\u003eaccess_token` for authenticate all our future requests.\n\nSee [example](examples/authentication.php).\n\n#### Client credentials flow \n\nIn order to access to public available resources such as categories or offers use client credentials flow:\n```php\n$token = $client-\u003efetchAccessTokenWithClientCredentials();\n```\n\n#### Device flow \n\nTo use browserless device flow use `getAuthUserCode()` method to get `user_code` and verification uri:\n```php\n$code = $client-\u003egetAuthUserCode();\n```\nand then after user authenticate device you can fetch `acces_token`:\n```php\n$code = ...\n\n$token = $client-\u003efetchAccessTokenWithDeviceCode($code-\u003edevice_code);\n```\n\n### Making Requests\n\n```php\n\u003c?php\n\n// Composer autoload\nrequire_once __DIR__.'/vendor/autoload.php';\n\n$credentials = ...\n$token = ...\n\n$client = new \\Ircykk\\AllegroApi\\Client($credentials);\n$client-\u003eauthenticate($token);\n\n$categories = $client-\u003esale()-\u003ecategories()-\u003eall();\n```\n\n### Making SOAP Requests\n\n```php\n$credentials = ...\n\n// WebApi SOAP client\n$soapClient = new \\Ircykk\\AllegroApi\\WebapiClient($credentials);\n\n$categories = $soapClient-\u003ewebApi()-\u003egetCatsDataLimit(0, 10);\n```\n\n### Sandbox\n\nIn order to use [Sandbox environment](https://allegro.pl.allegrosandbox.pl/) just set `Credentials` property `$sandbox` to true.\n```php\n$credentials = new \\Ircykk\\AllegroApi\\Credentials(\n    ...\n    true // Sandbox\n);\n```\n\n### Cache usage\nUse any PSR-6 compatible library to cache requests.\n\nIn this example we use Symfony Cache, to install just run:\n```bash\n$ composer require symfony/cache\n```\n\n```php\n$credentials = ...\n$client = new Client($credentials);\n\n$cache = new FilesystemAdapter();\n$client-\u003eaddCache($cache, ['default_ttl' =\u003e 3600]);\n```\nSee [example](examples/cache.php).\n\n### Logger\nUse any PSR-3 logger library for example Monolog, to install just run:\n```bash\n$ composer require monolog/monolog\n```\n\n```php\n$credentials = ...\n$client = new Client($credentials);\n\n$logger = new Logger('api');\n$logger-\u003epushHandler(\n    new StreamHandler(__DIR__.'/api.log', Logger::DEBUG)\n);\n$loggerPlugin = new LoggerPlugin($logger);\n$client-\u003eaddPlugin($loggerPlugin);\n```\nSee [example](examples/log.php).\n\n### Customization\nThanks to HTTPlug library can be customized easily, for example to set language use [HeaderDefaultsPlugin](http://docs.php-http.org/en/latest/plugins/headers.html) plugin:\n```php\n...\n$headerDefaultsPlugin = new HeaderDefaultsPlugin([\n    'Accept-Language' =\u003e 'en-US'\n]);\n$client-\u003eaddPlugin($headerDefaultsPlugin);\n```\nSee [full list](http://docs.php-http.org/en/latest/plugins/index.html) of available HTTPlug plugins.\n\n## TO-DO\n* Tests\n* Documentation\n\n## Contributing\nFeel free to contribute.\n\n## Credits\nAPI client build on top of [HTTPlug](http://httplug.io/) and inspired by [KnpLabs](https://github.com/KnpLabs/) GitHub client.\n\nSoap types generated by [wsdl2phpgenerator](https://github.com/wsdl2phpgenerator/wsdl2phpgenerator) library.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fircykk%2Fallegro-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fircykk%2Fallegro-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fircykk%2Fallegro-api/lists"}