bundesAPI / bundesAPI/handelsregister

Python packaging fails / PHP implementation desirable

Open
#29 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
438
Forks
61
PR merge metrics
No merged PRs in 30d

Description

On a current Mac, `poetry` [installed via Homebrew](https://formulae.brew.sh/formula/poetry#default) fails:

```
$ poetry install

Command ['/opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/bin/python3.12', '-I', '-W', 'ignore', '-c', 'import sys\n\nif hasattr(sys, "real_prefix"):\n print(sys.real_prefix)\nelif hasattr(sys, "base_prefix"):\n print(sys.base_prefix)\nelse:\n print(sys.prefix)\n'] errored with the following return code -10
```

A PHP implementation would be desirable to obtain structured information (SI) as well as the current (AD) and chronological excerpt (CD) for a given legal entity.
With the Laravel framework, either [Laravel's HTTP client](https://laravel.com/docs/11.x/http-client#request-data) powered by Guzzle might be used, or [Laravel Dusk](https://laravel.com/docs/11.x/dusk#browser-basics) using a Selenium compatible driver if JavaScript is required. Unfortunately, this [seems](https://github.com/bundesAPI/handelsregister/issues/4#issuecomment-1210438556) to be the case.

Both a request with `curl` (`curl -d "registerArt_input=VR" -d "registerNummer=304" -d "registergericht_input=D2601" https://www.handelsregister.de/rp_web/erweitertesuche.xhtml`) as well as a request with Laravel's HTTP client (obtaining the cookie in a first request, then reusing this cookie requesting the extended search form) fails with the error message "session expired".

Test using PHP Pest:

```
use Illuminate\Support\Facades\Http;

it('makes a request at handelsregister.de',
closure: function () {
$response = Http::get('https://www.handelsregister.de');

// https://stackoverflow.com/a/70330475
$cookie_value = $response->cookies->getCookieByName('JSESSIONID')->getValue();

dump($cookie_value);

// Advanced search
$response = Http::withCookies(['JSESSIONID' => $cookie_value],
'www.handelsregister.de')->get('https://www.handelsregister.de/rp_web/welcome.xhtml#');

dump($response);
});
```

It's a shame that the German federal services don't offer a proper API.
Also, a rate limit of 60 requests per hour is ridiculous for publicly available data.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.