PHPackages                             fw4/realo-api-client - 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. fw4/realo-api-client

ActiveLibrary[API Development](/categories/api)

fw4/realo-api-client
====================

Realo API client

v1.0.3(2y ago)06MITPHPPHP &gt;=8.0

Since Apr 22Pushed 7mo agoCompare

[ Source](https://github.com/fw4-bvba/realo-api-client)[ Packagist](https://packagist.org/packages/fw4/realo-api-client)[ RSS](/packages/fw4-realo-api-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

Realo API PHP Library
=====================

[](#realo-api-php-library)

A PHP library for using [the Realo REST API](https://api.realo.com/docs).

Before using this library, you must have a valid API Key. To get an API Key, please contact your Realo customer success manager.

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

[](#installation)

### As a composer dependency (Recommended)

[](#as-a-composer-dependency-recommended)

The recommended way to install the Realo PHP API client is through [composer](https://getcomposer.org/download/).

Next, run the `composer` command to install the Realo PHP API client:

```
composer require fw4/realo-api-client
```

After installing, you need to require Composer's autoloader:

```
require_once __DIR__ . '/vendor/autoload.php';
```

Initialization
--------------

[](#initialization)

#### RealoApi::create(publicKey, privateKey, environment)

[](#realoapicreatepublickey-privatekey-environment)

- `publicKey`
    - Type: `string`
    - API public key
- `privateKey`
    - Type: `string`
    - API private key
- `environment`
    - Type: `string`
    - Default value: `production`
    - API environment (either `production` or `sandbox`)

#### RealoApi::createWithClient(publicKey, privateKey, client)

[](#realoapicreatewithclientpublickey-privatekey-client)

- `publicKey`
    - Type: `string`
    - API public key
- `privateKey`
    - Type: `string`
    - API private key
- `client`
    - Type: `GuzzleHttp\Client`
    - Guzzle HTTP client, used for communicating with the REST API

Methods
-------

[](#methods)

### request(path, method, \[, payload \[, headers\]\])

[](#requestpath-method--payload--headers)

- `path`
    - Type: `string`
    - The path of the resource
- `method`
    - Type: `string`
    - HTTP method for request
- `payload`
    - Type: `array`
    - HTTP payload (to be encoded as JSON), only applies when the HTTP method is not `GET`
- `headers`
    - Type: `array`
    - Custom headers to be sent with the request.

Examples
--------

[](#examples)

### Use The Bundled CLI Tool

[](#use-the-bundled-cli-tool)

We provide a simple CLI utility which you can use to interact with our API.

```
$ php example/simple-cli.php --public-key=xxx --private-key=xxx /valuations/xxx/data/mobility
{
    "data": {
        "mobilityScore": 0.88,
        "distanceToCityCenter": 3130,
        "distanceToBusStop": 323,
        "distanceToTrainStation": 1197,
        "distanceToSchool": 77,
        "distanceToStores": 33,
        "distanceToHighways": 3282,
        "buildingDensity": 1688.01,
        "inhabitantsDensity": 32346.18,
        "transitTypeCityCenter": "cycling-distance",
        "transitTypeBusStop": "walking-distance",
        "transitTypeTrainStation": "walking-distance",
        "transitTypeSchool": "walking-distance",
        "transitTypeStores": "walking-distance"
    }
}
```

### Send An API Call Using The Request Function

[](#send-an-api-call-using-the-request-function)

We provide a base request function to access any of our API resources.

```
use Realo\Api\RealoApi;
use Realo\Api\RealoApiException;

$api = RealoApi::create('YOUR_PUBLIC_KEY', 'YOUR_PRIVATE_KEY');
try {
    $response = $api->request('/agencies', 'GET');
    var_dump($response);
} catch (RealoApiException $e) {
    printf("Error %d: %s\n", $e->getCode(), $e->getMessage());
}
```

Exceptions
----------

[](#exceptions)

An exception will be thrown in two cases: there is a problem with the request or the server returns a status code of `400` or higher.

### RealoApiException

[](#realoapiexception)

- **getCode()**
    - Returns the response status code of `400` or higher.
- **getMessage()**
    - Returns the exception message.
- **getErrors()**
    - If there is a response body containing an `array` of errors, return these. Otherwise returns `null`.
- **getType()**
    - If there is a response body containing an error, return its type. Otherwise returns `null`.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance44

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 65.2% 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

Unknown

Total

1

Last Release

752d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2fe7a44c5e07cf8dd0eed2941b88dcab03342fb149ede5347b3467bc17691d4e?d=identicon)[Fyrts](/maintainers/Fyrts)

---

Top Contributors

[![mcuelenaere](https://avatars.githubusercontent.com/u/1682432?v=4)](https://github.com/mcuelenaere "mcuelenaere (15 commits)")[![fyrts](https://avatars.githubusercontent.com/u/5918336?v=4)](https://github.com/fyrts "fyrts (4 commits)")[![DeKerpelLaurent](https://avatars.githubusercontent.com/u/7040102?v=4)](https://github.com/DeKerpelLaurent "DeKerpelLaurent (2 commits)")[![V1ncent](https://avatars.githubusercontent.com/u/6650996?v=4)](https://github.com/V1ncent "V1ncent (2 commits)")

### Embed Badge

![Health badge](/badges/fw4-realo-api-client/health.svg)

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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