opendaje/isbndb-client

IsbnDb API客户端。

0.1.1 2024-04-05 11:53 UTC

README

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

CD/CI

⚠ 早期版本发布(0.x.x)可能会根据 语义版本控制2.0 打破API。我们使用 次要 版本来表示重大变更。随着稳定版 1.0.0 的发布,这将会改变。

PHP API客户端,用于ISBNdb数据库。

安装

composer require opendaje/isbndb-client

// add a PSR Http client

composer require http-interop/http-factory-guzzle php-http/guzzle6-adapter

使用方法

https://isbndb.com/isbn-database注册您的API密钥

<?php declare(strict_types=1);

use IsbnDbClient\IsbnDbClient;

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

$token = 'YOUR_API_KEY';

$client = new IsbnDbClient();
$client->authenticate($token);

try {
    $response = $client->api('author')->searchAuthors('eric evans');

    print_r($response);
} catch (Exception $exception){
    print_r($exception->getMessage());
}