PHPackages                             bclibraries/primo-client - 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. bclibraries/primo-client

ActiveLibrary

bclibraries/primo-client
========================

A client for Ex Libris' Primo REST API

v1.0.1(1y ago)1274[1 PRs](https://github.com/BCLibraries/primo-client/pulls)MITPHPPHP ^8.1

Since Apr 17Pushed 1y ago4 watchersCompare

[ Source](https://github.com/BCLibraries/primo-client)[ Packagist](https://packagist.org/packages/bclibraries/primo-client)[ RSS](/packages/bclibraries-primo-client/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (24)Used By (0)

Primo Client
============

[](#primo-client)

A client for accessing the [Primo Brief Search RESTful API](https://developers.exlibrisgroup.com/primo/apis/docs/primoSearch/R0VUIC9wcmltby92MS9zZWFyY2g=/) in PHP.

Installation
------------

[](#installation)

Use [composer](https://getcomposer.org/) to install Primo-Client.

```
composer require bclibraries/primo-client:^0.3
```

Primo Client is currently a 0.\* release, so things might change drastically with any minor release.

Usage
-----

[](#usage)

Create a configuration hash and pass it to `PrimoClient::build()` to instantiate a client.

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

$config = [
    'apikey' => 'l7xx38c6a1a3043974262e81a81fb7475ba9',
    'gateway' => 'https://api-na.hosted.exlibrisgroup.com',
    'vid' => 'my_vid',
    'tab' => 'the_tab',
    'scope' => 'mylib'
];
$primo = \BCLib\PrimoClient\PrimoClient::build(
                                                $config['gateway'],
                                                $config['apikey'],
                                                $config['tab'],
                                                $config['vid'],
                                                $config['scope']
                                               );
$response = $primo->search('otters');
```

Passing a string to `search()` will perform a simple keyword search. For more complex searches, pass in a `SearchRequest` object:

```
$request = $primo->getSearchRequest();

$contains_manchurian_candidate = new \BCLib\PrimoClient\Query('any','contains','manchurian candidate');
$contains_demme = new \BCLib\PrimoClient\Query('creator','contains','demme');

$is_video = new \BCLib\PrimoClient\QueryFacet('facet_rtype','exact','video');

$request->addQuery($contains_manchurian_candidate)
    ->addQuery($contains_demme, 'NOT')
    ->include($is_video)
    ->sort('date')
    ->limit(5);

$response = $primo->search($request);
```

The JSON structure of a SearchResponse can be accessed directly:

```
echo "{$response->json->info->total} total results\n";
foreach ($response->json->docs as $doc) {
    echo "{$doc->pnx->display->title[0]}\n";
}
```

or through convenience parameters:

```
echo "{$response->total} total results\n";
foreach ($response->docs as $doc) {
    echo "{$doc->title}\n";
}
```

### Running tests

[](#running-tests)

[PHPUnit](https://phpunit.de/) is used for testing. To run:

```
vendor/bin/phpunit test
```

Contributing
------------

[](#contributing)

1. Fork it ()
2. Create your feature branch (git checkout -b feature/fooBar)
3. Commit your changes (git commit -am 'Add some fooBar')
4. Push to the branch (git push origin feature/fooBar)
5. Create a new Pull Request

Please make sure to update tests as appropriate.

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 97.9% 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 ~97 days

Recently: every ~323 days

Total

21

Last Release

633d ago

Major Versions

0.9.1 → v1.0.12024-08-20

PHP version history (2 changes)v0.1.0PHP &gt;=7.1.0

0.8.1PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/210404?v=4)[Benjamin Florin](/maintainers/Otterfan)[@Otterfan](https://github.com/Otterfan)

---

Top Contributors

[![Otterfan](https://avatars.githubusercontent.com/u/210404?v=4)](https://github.com/Otterfan "Otterfan (46 commits)")[![LukeGaudreau](https://avatars.githubusercontent.com/u/120206?v=4)](https://github.com/LukeGaudreau "LukeGaudreau (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bclibraries-primo-client/health.svg)

```
[![Health](https://phpackages.com/badges/bclibraries-primo-client/health.svg)](https://phpackages.com/packages/bclibraries-primo-client)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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