Simple PHP wrapper for Zeitfracht's webservice API, written in PHP
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Martin Folkers 80b058e852
Bump version
2 days ago
data Rewrite everything 1 month ago
docs Rename PDF docs 2 days ago
src Switch into production mode 2 days ago
tests Remove caching implementation 2 days ago
.editorconfig Migrate project to '' 1 month ago
.gitattributes Rewrite everything 1 month ago
.gitignore Rewrite everything 1 month ago
.woodpecker.yml Restructure project, remove SOAP client 1 month ago
LICENSE Initial commit 3 years ago Switch into production mode 2 days ago
composer.json Bump version 2 days ago
login.example.json Improving support for audiobooks 2 years ago
phpunit.xml Rewrite everything 1 month ago
pint.json Rewrite everything 1 month ago
psalm.xml Resolve psalm errors 4 weeks ago


License Packagist Build


This small library may be used to gather information about books by utilizing the JSON API powering, developed by Zeitfracht, a german wholesale book distributor. The official API documentation can be found here.


It powers our book recommendations & downloads cover images from the German National Library.


It's available for Composer:

composer require fundevogel/php-pcbis

Basic workflow

Getting started is pretty straight-forward:



use Fundevogel\Pcbis\Pcbis;

# Create object, passing credentials as first parameter (for caching, see below)
$object = new Pcbis([/* ... */]);

try {
    # After loading a book, you might want to ..
    $book = $object->load('978-3-522-20255-8');

    # (1) .. export its bibliographic data
    $data = $book->export();

    # (2) .. access specific information
    echo $book->title();

    # (3) .. download its cover
    if ($book->downloadCover()) {
        echo 'Cover downloaded!';

    # (4) .. query its OLA status
    if ($book->isAvailable()) {
        # ...

} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage(), "\n";

Note: While using this library during development, please consider using the API testing endpoint like so:

# Initialize API wrapper
$api = new Webservice($credentials);

# Use 'testing' URL 
$api->url = '';

If you want to load several EANs/ISBNs, use loadAll(array $identifiers) which returns a Products object.

Note: Starting with v3, ISBN validation is no longer enabled by default. If you want formatted (= hyphenated) ISBNs when calling isbn() (if available), php-pcbis takes care of this for you if nicebooks/isbn is installed.


By default, php-pcbis doesn't implement any caching mechanism. If you want to store data - and you probably should - this could be achieved something like this:


use Fundevogel\Pcbis\Pcbis;

$obj = new Pcbis([/* ... */]);
$ean = 'identifier';

if ($myCache->has($ean)) {
    $data = $myCache->get($ean);
    $product = $obj->load($data);

else {
    $product = $obj->load($ean);
    $myCache->set($ean, $product->data);


Most of the helper functions were taken from Kirby's excellent toolkit package by Bastian Allgeier (who's just awesome, btw).

Happy coding!

© Fundevogel Kinder- und Jugendbuchhandlung