PHPackages                             art4/wegliphant - 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. art4/wegliphant

ActiveLibrary[API Development](/categories/api)

art4/wegliphant
===============

PHP client for weg.li API

0.3.0(2y ago)24[3 issues](https://github.com/Art4/wegliphant/issues)GPL-3.0-or-laterPHPPHP ^8.1

Since Mar 5Pushed 2y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (5)Versions (4)Used By (0)

🐘 Wegliphant
============

[](#-wegliphant)

[![Latest Version](https://camo.githubusercontent.com/8c74c1f85934c0179f45e666938deef0e09f9ebea9cb3a7bfde174cfc33ef978/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f417274342f7765676c697068616e742e737667)](https://github.com/Art4/wegliphant/releases)[![Software License](https://camo.githubusercontent.com/803e5a1d6927fdb2a35e55d2c17fdf600894fccdabb0185ce678488218f68d91/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d47504c332532306f722532306c617465722d627269676874677265656e2e737667)](LICENSE.md)[![Build Status](https://github.com/Art4/wegliphant/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/Art4/wegliphant/actions)[![codecov](https://camo.githubusercontent.com/e591f118c90e5e29e8e857e84c6a75f857e1555e3257e63c2b64982ec0b67c5c/68747470733a2f2f636f6465636f762e696f2f67682f417274342f7765676c697068616e742f67726170682f62616467652e7376673f746f6b656e3d384a3050424e334b4a45)](https://codecov.io/gh/Art4/wegliphant)[![Total Downloads](https://camo.githubusercontent.com/1dc773bcaff1efddb4722d77d9db8fc8be9166e3a65af4dac46410fccf848f0e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617274342f7765676c697068616e742e737667)](https://packagist.org/packages/art4/wegliphant)

🐘 Wegliphant is a PHP client for the [weg.li](https://www.weg.li/) 🚲💨 API.

- API Docs:
- API Source:
- API Version:
- API Datetime: 2024-03-22T08:19:09Z

Requires: PHP ^8.1

Usage
-----

[](#usage)

### Installation

[](#installation)

You can install Wegliphant using [Composer](https://getcomposer.org/):

```
composer require art4/wegliphant
```

Don't forget to load the autoloader using `require 'vendor/autoload.php';`.

### Setup

[](#setup)

Wegliphant requires a [PSR-18 HTTP client](https://packagist.org/providers/psr/http-client-implementation)and [PSR-17 Request factory](https://packagist.org/providers/psr/http-factory-implementation) implementation.

This example uses [Guzzle](http://docs.guzzlephp.org/):

```
$client = \Art4\Wegliphant\Client::create(
    new \GuzzleHttp\Client(),
    new \GuzzleHttp\Psr7\HttpFactory(),
);
```

Optionally, you can use `authenticate()` to set an API key. Nearly all areas of the weg.li API require an API key. Without the API key, all requests are send without authorization. You can find your API key [here](https://www.weg.li/user/edit).

```
$client->authenticate($apiKey);
```

### List all own notices

[](#list-all-own-notices)

```
$notices = $client->listOwnNotices();

// $notices contains:
[
    [...],
    [
        'token' => '8843d7f92416211de9ebb963ff4ce281',
        'status' => 'shared',
        'street' => 'Musterstraße 123',
        'city' => 'Berlin',
        'zip' => '12305',
        'latitude' => 52.5170365,
        'longitude' => 13.3888599,
        'registration' => 'EX AM 713',
        'color' => 'white',
        'brand' => 'Car brand',
        'charge' => [
            'tbnr' => '141312',
            'description' => 'Sie parkten im absoluten Haltverbot (Zeichen 283).',
            'fine' => '25.0',
            'bkat' => '§ 41 Abs. 1 iVm Anlage 2, § 49 StVO; § 24 Abs. 1, 3 Nr. 5 StVG; 52 BKat',
            'penalty' => null,
            'fap' => null,
            'points' => 0,
            'valid_from' => '2021-11-09T00:00:00.000+01:00',
            'valid_to' => null,
            'implementation' => null,
            'classification' => 5,
            'variant_table_id' => 741017,
            'rule_id' => 39,
            'table_id' => null,
            'required_refinements' => '00000000000000000000000000000000',
            'number_required_refinements' => 0,
            'max_fine' => '0.0',
            'created_at' => '2023-09-18T15:30:43.312+02:00',
            'updated_at' => '2023-09-18T15:30:43.312+02:00',
        ],
        'tbnr' => '141312',
        'start_date' => '2023-11-12T11:31:00.000+01:00',
        'end_date' => '2023-11-12T11:36:00.000+01:00',
        'note' => 'Some user notes',
        'photos' => [
            [
                'filename' => 'IMG_20231124_113156.jpg',
                'url' => 'https://example.com/storage/IMG_20231124_113156.jpg',
            ],
        ],
        'created_at' => '2023-11-12T11:33:29.423+01:00',
        'updated_at' => '2023-11-12T11:49:24.383+01:00',
        'sent_at' => '2023-11-12T11:49:24.378+01:00',
        'vehicle_empty' => true,
        'hazard_lights' => false,
        'expired_tuv' => false,
        'expired_eco' => false,
        'over_2_8_tons' => false,
    ],
    [...],
],
```

### Get one notice by token

[](#get-one-notice-by-token)

```
$notice = $client->getNoticeByToken('8843d7f92416211de9ebb963ff4ce281');

// $notice contains:
[
    'token' => '8843d7f92416211de9ebb963ff4ce281',
    'status' => 'shared',
    'street' => 'Musterstraße 123',
    'city' => 'Berlin',
    'zip' => '12305',
    'latitude' => 52.5170365,
    'longitude' => 13.3888599,
    'registration' => 'EX AM 713',
    'color' => 'white',
    'brand' => 'Car brand',
    'charge' => [
        'tbnr' => '141312',
        'description' => 'Sie parkten im absoluten Haltverbot (Zeichen 283).',
        'fine' => '25.0',
        'bkat' => '§ 41 Abs. 1 iVm Anlage 2, § 49 StVO; § 24 Abs. 1, 3 Nr. 5 StVG; 52 BKat',
        'penalty' => null,
        'fap' => null,
        'points' => 0,
        'valid_from' => '2021-11-09T00:00:00.000+01:00',
        'valid_to' => null,
        'implementation' => null,
        'classification' => 5,
        'variant_table_id' => 741017,
        'rule_id' => 39,
        'table_id' => null,
        'required_refinements' => '00000000000000000000000000000000',
        'number_required_refinements' => 0,
        'max_fine' => '0.0',
        'created_at' => '2023-09-18T15:30:43.312+02:00',
        'updated_at' => '2023-09-18T15:30:43.312+02:00',
    ],
    'tbnr' => '141312',
    'start_date' => '2023-11-12T11:31:00.000+01:00',
    'end_date' => '2023-11-12T11:36:00.000+01:00',
    'note' => 'Some user notes',
    'photos' => [
        [
            'filename' => 'IMG_20231124_113156.jpg',
            'url' => 'https://example.com/storage/IMG_20231124_113156.jpg',
        ],
    ],
    'created_at' => '2023-11-12T11:33:29.423+01:00',
    'updated_at' => '2023-11-12T11:49:24.383+01:00',
    'sent_at' => '2023-11-12T11:49:24.378+01:00',
    'vehicle_empty' => true,
    'hazard_lights' => false,
    'expired_tuv' => false,
    'expired_eco' => false,
    'over_2_8_tons' => false,
],
```

### List all districts

[](#list-all-districts)

```
$districts = $client->listDistricts();

// $districts contains:
[
    [...],
    [
        'name' => 'Berlin',
        'zip' => '12305',
        'email' => 'mail@example.com',
        'prefixes' => [
            'B',
        ],
        'latitude' => 52.5170365,
        'longitude' => 13.3888599,
        'aliases' => null,
        'personal_email' => false,
        'created_at' => '2019-09-24T14:56:35.624+02:00',
        'updated_at' => '2020-03-06T17:53:09.034+01:00',
    ],
    [...],
],
```

### Get one district by zip

[](#get-one-district-by-zip)

```
$district = $client->getDistrictByZip('12305');

// $district contains:
[
    'name' => 'Berlin',
    'zip' => '12305',
    'email' => 'mail@example.com',
    'prefixes' => [
        'B',
    ],
    'latitude' => 52.5170365,
    'longitude' => 13.3888599,
    'aliases' => null,
    'personal_email' => false,
    'created_at' => '2019-09-24T14:56:35.624+02:00',
    'updated_at' => '2020-03-06T17:53:09.034+01:00',
],
```

### List all charges

[](#list-all-charges)

```
$charges = $client->listCharges();

// $charges contains:
[
    [...],
    [
        'tbnr' => '141313',
        'description' => 'Sie parkten im absoluten Haltverbot (Zeichen 283) und behinderten +) dadurch Andere.',
        'fine' => '40.0',
        'bkat' => '§ 41 Abs. 1 iVm Anlage 2, § 1 Abs. 2, § 49 StVO; § 24 Abs. 1, 3 Nr. 5 StVG; 52.1 BKat; § 19 OWiG',
        'penalty' => null,
        'fap' => null,
        'points' => 0,
        'valid_from' => '2021-11-09T00:00:00.000+01:00',
        'valid_to' => null,
        'implementation' => 2,
        'classification' => 5,
        'variant_table_id' => 741017,
        'rule_id' => 39,
        'table_id' => null,
        'required_refinements' => '00000000000000000000000000000000',
        'number_required_refinements' => 1,
        'max_fine' => '0.0',
        'created_at' => '2023-09-18T15:30:43.329+02:00',
        'updated_at' => '2023-09-18T15:30:43.329+02:00',
    ],
    [...],
],
```

### List one charge by tbnr

[](#list-one-charge-by-tbnr)

```
$charge = $client->getChargeByTbnr('141313');

// $charge contains:
[
    'tbnr' => '141313',
    'description' => 'Sie parkten im absoluten Haltverbot (Zeichen 283) und behinderten +) dadurch Andere.',
    'fine' => '40.0',
    'bkat' => '§ 41 Abs. 1 iVm Anlage 2, § 1 Abs. 2, § 49 StVO; § 24 Abs. 1, 3 Nr. 5 StVG; 52.1 BKat; § 19 OWiG',
    'penalty' => null,
    'fap' => null,
    'points' => 0,
    'valid_from' => '2021-11-09T00:00:00.000+01:00',
    'valid_to' => null,
    'implementation' => 2,
    'classification' => 5,
    'variant_table_id' => 741017,
    'rule_id' => 39,
    'table_id' => null,
    'required_refinements' => '00000000000000000000000000000000',
    'number_required_refinements' => 1,
    'max_fine' => '0.0',
    'created_at' => '2023-09-18T15:30:43.329+02:00',
    'updated_at' => '2023-09-18T15:30:43.329+02:00',
],
```

Development
-----------

[](#development)

You can use Docker to create the full develoment environment.

```
docker compose build
docker compose up -d
docker compose exec php php --version
```

This will look like this:

```
$ docker compose exec php php --version
PHP 8.3.3 (cli) (built: Feb 16 2024 21:02:14) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.3, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.3, Copyright (c), by Zend Technologies
    with Xdebug v3.3.1, Copyright (c) 2002-2023, by Derick Rethans
```

### Tests

[](#tests)

We are using [PHPUnit](https://phpunit.de), [PHPStan](https://phpstan.org/) and [PHP-CS-Fixer](https://cs.symfony.com/) for tests, static code anaylsis and for enforcing the code style [PER-CS2.0](https://www.php-fig.org/per/coding-style/). You can run all checks using the composer script `test`:

```
docker compose exec php composer test
```

You can also run one specific check using the composer scripts `phpstan`, `phpunit` or `codestyle`:

```
docker compose exec php composer phpstan
docker compose exec php composer phpunit
docker compose exec php composer codestyle
```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

Total

3

Last Release

797d ago

PHP version history (2 changes)0.1.0PHP ^8.3

0.2.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ad0c0fa748422ad817c4124a06618a1e655995502be8d6f03d699f38c0d56b0?d=identicon)[Art4](/maintainers/Art4)

---

Top Contributors

[![Art4](https://avatars.githubusercontent.com/u/2162994?v=4)](https://github.com/Art4 "Art4 (81 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/art4-wegliphant/health.svg)

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

###  Alternatives

[kbsali/redmine-api

Redmine API client

4221.1M24](/packages/kbsali-redmine-api)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[swisnl/json-api-client

A PHP package for mapping remote JSON:API resources to Eloquent like models and collections.

211473.2k12](/packages/swisnl-json-api-client)[wordpress/php-ai-client

A provider agnostic PHP AI client SDK to communicate with any generative AI models of various capabilities using a uniform API.

26236.6k14](/packages/wordpress-php-ai-client)[prokerala/astrology-sdk

Prokerala.com Astrology API Client Library for PHP.

2610.0k](/packages/prokerala-astrology-sdk)[luzrain/telegram-bot-api

PHP Wrapper for Telegram Bot API

1032.8k1](/packages/luzrain-telegram-bot-api)

PHPackages © 2026

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