Ready to Learn?Ex Libris products all provide open APIs

Tech Blog


Bulk Export Titles from Primo Using Primo Search Api

Blake Galbreath on December 4th, 2018

In this example, I use the Primo Search Api to collect all of the database titles from Primo and then export them to a local file.


Method: Windows Powershell
Pre-requisites: Primo Search Api Key
Primo Search API Doc:

Steps taken within Powershell:

1.) Define Api Url:

$api = '{apiServer}/primo/v1/search?vid={vid}&tab={tab}&scope={scope}&pcAvailability={true/false]&q=any,contains,{query}&qInclude=facet_rtype,exact,{facet}&limit={limit}&apikey={apiKey}'

2.) Convert data from JSON:

$results = Invoke-WebRequest -Uri $api | ConvertFrom-Json

3.) Define source of database titles in pnx:

$dbTitles = $

4.) Output data to a file:

foreach ($dbTitle in $dbTitles) {
$o = new-object PSObject
$o | add-member NoteProperty DatabaseTitles $dbTitle
$o | Export-Csv "C:\file_path\file_name.csv" -append -NoType