View on GitHub

Php-kb-rest-api-lite

A lightweight version of the php api

Download this project as a .zip file Download this project as a tar.gz file

This code was created at the OCLC Developer House to provide a simple PHP interface to the OCLC's WorldCat Knowledge Base API.

See the API Wiki for usage details.

Pre-requisites

Create your own configuration file mykey.txt

wskey = xxxx
inst_id = 123456

Sample application to display Knowledge Base Providers

<?php
  include 'kbService.php';
  include 'oclcClient.php';
?>
<html>
<body>

<?php   
  $kbService = new kbService("mykey.txt");
  $oclcClient = new oclcClient("index.php", $_GET);

  $providers = $kbService->getProviders($oclcClient->serviceOpt, $oclcClient->pageOpt);

  echo "<h2>KB Providers for {$kbService->getInstId()}</h2>";
  echo $oclcClient->getPaginationSummary($providers, "Providers");
  echo $oclcClient->getTable($providers);       
?>
</body>
</html>