PHPackages                             hscore/hsapi - 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. hscore/hsapi

ActiveLibrary

hscore/hsapi
============

REST api for B2B partners of Hifi Station Kft.

1.0.7(3y ago)112MITPHPPHP &gt;=7.4

Since Jun 27Pushed 3y ago1 watchersCompare

[ Source](https://github.com/csedo/hsapi)[ Packagist](https://packagist.org/packages/hscore/hsapi)[ RSS](/packages/hscore-hsapi/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)DependenciesVersions (5)Used By (0)

HSApi
=====

[](#hsapi)

In Hifi Station Kft we decided to create a new automation system for our B2B partners. You can connect your webshop, ecommerce, or any other system to our API.

We won't be able to write your backend code but we will help you to create the connection.

The api does not support OpenCart/Magento/PrestaShop/WooCommerce/Unas/Shoprenter/etc. You need to write your own code to connect to your system.

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

[](#requirements)

- PHP 7.4
- Composer
- ext-openssl: \*
- ext-simlexml: \*
- ext-json: \*

Features
--------

[](#features)

- List products with informations
- Secure authentication (HTTP Basic Auth + API Key)
- JSON/XML REST output

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

[](#installation)

```
"hscore/hsapi": "*"

```

or run

```
composer require hscore/hsapi

```

Note that the vendor folder and the vendor/autoload.php script are generated by Composer; they are not part of the api.

Alternatively, if you're not using Composer, you can download HSApi as a zip file, then copy the contents of the HSApi folder into one of the include\_path directories specified in your PHP configuration and load class file manually:

```
use hscore\RequestGenerator;
require 'path/to/src/RequestGenerator.php'; /* or wherever the file is located */
```

Authentication
--------------

[](#authentication)

In order to use the API you need to authenticate. You can do this by using the `authenticate` method.

We prepared a simlified authentication method.

You can use the authentication credentails in the following way: `https://api.hifi-station.hu/v2/products?username=USERNAME&password=PASSWORD&api_key=API_KEY`In the email that we send you after a successful registration copy the data and change the UPPERCASE strings. You can change the output (JSON or XML) by adding the extension to "products". `https://api.hifi-station.hu/v2/products.xml` or `json`

```
$request->authenticate('api_username', 'api_password', 'api_key');
```

Output format
-------------

[](#output-format)

We provide two output formats: JSON and XML. To change the output format, use the `setOutputFormat` method.

```
$request->setOutputFormat('json'); // or 'xml', default is 'json'
```

Use this method before the `send()` method.

Usage
-----

[](#usage)

```
$request = new RequestGenerator('products');
$request->authenticate('api_username', 'api_password', 'api_key');

$response = $request->send();

echo $response;
```

### Other informations

[](#other-informations)

Note, that the API is not stable yet. In the result the `stock` tag is not always correct. If we have more than 10 product in stock the value always will be 10.

### Functions

[](#functions)

`send()` return the response in the format you specified.

`authenticate(string $username, string $password, string $api_key)` authenticate the request.

`setOutputFormat(string $type)` set the output format.

`public $disablePrettyHeader = false;` disable the php `header()` function.

Security
--------

[](#security)

Please submit bug reports, or you found a mistake in the docs, or want to add something suggestions create a pull request or go ahead and create an issue at [Github issue tracker](https://github.com/csedo/hsapi/issues "Github issue tracker")

Disclaimer
----------

[](#disclaimer)

This is an open source project. We are not responsible for any damage caused by this software. If you want to update the prices of the product automatically, please note that it may differ from the price you offer.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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

Total

4

Last Release

1411d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/40db9455bb634b2be2d0692a5c378f2151ef9eab94b8a7d2ba7ee73a9e809df6?d=identicon)[csedwik](/maintainers/csedwik)

---

Top Contributors

[![csedo](https://avatars.githubusercontent.com/u/57478651?v=4)](https://github.com/csedo "csedo (17 commits)")

### Embed Badge

![Health badge](/badges/hscore-hsapi/health.svg)

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

PHPackages © 2026

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