Tech Blog

Bulk Export Titles from Primo using Primo Search API

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


Leave a Reply