Ready to Learn?Ex Libris products all provide open APIs

  • Primo resources
  • Alma resources
  • Rosetta resources
  • Leganto resources
  • bX resources
  • SFX resources
  • Aleph resources
  • Voyager resources

General Purpose

Create direct links into your Primo site.
Be able to create a link leading to the brief result page of your Primo site.



Base URL

The base URL to be used is: http://<primo domain>/primo_library/libweb/action/

To this URL you must supply additional parameters.



Input Parameters

queryThe query parameter is a combination of three attributes that are separated by a comma: 

1) field - The field to search against 
2) precision - A precision operator (i.e exact/contains/begins_with) 
3) value - Any value 

&query=any,contains,queens+of+the+stone+age (the value contains more than one term in it) 
&query=any,contains,queens&query=dr_s,exact,20100101&query=dr_e,exact,20101231 (see description for the dr_s and dr_e attributes below)

Note: The query parameter can be used more than once in the URL thus causing for an AND correlation between the two values: 

For example: 

1) <field> possible values: 
The field names to be used are field names used by the search engine. As such their names are a bit different than what you would expect. The below will list the relevant field names: 
a) any - 
     Will search against most of the fields at once. 
     Example: &query=any,contains,queens 
b) regular fields - 
     (taken from the code table: "Basic Index Fields"): 
    desc, title, creator, sub (subject), rtype (resource type), isbn, issn, 
     rectype (record type), dlink (down link), ftext (full text), general, toc, fmt, 
     lang, cdate (creation date), sid (source ID), rid (record ID), 
     addsrcrid (additional source ID), addtitle, pnxtype, alttitle, 
     abstract, and fiction 
     Example: &query=rid,exact,PRIMO1234 
b) facet fields - 
    (taken from the code table: "Facets Code Fields"): 
    facet_creator, facet_lang, facet_rtype, facet_pfilter, facet_topic, 
    facet_creationdate, facet_dcc, facet_lcc, facet_rvk, 
    facet_tlevel,facet_domain, facet_fsize, facet_fmt, facet_frbrgroupid, 
    facet_frbrtype, facet_local1 - facet_local50 
    Example: &query=facet_creator,william+s+burroughs 

2) <precision>possible values:

NOTE: for facets, the only possible precision value is exact (i.e. &query=facet_topic,exact,Nonfiction)

a) exact - When searching for a phrase (more than one term, 
                 i.e "queens of the stone age") and we want an exact match 
                 for this phrase. 
                 Note: When querying for one term there is no difference 
                            between exact and contains 
                Example: &query=title,exact,queens+of+the+stone+age 
b) contains -When searching for one term, will return results for any field 
                       containing this term. When searching for a phrase, will return 
                       results for any field containing at least one of the given terms. 
                       For example: 

                      will return titles like: 
                      "the age of life", "kings and queens" or 
                      "age and health of queens

c) begins_with - Works only against the sort title field (swstitle)! 
                             The swstitle was not mentioned above. The swstitle is the 
                             title under the sort section in the PNX. 
                             Note: 1) When using this precision, there is no meaning to 
                                            the field you are using, as it will always search 
                                            against the swstitle field!
                                        2) Usually you will want to use sortField=stitle, when searching with begins_with (and not the default relevance)

3) <value> possible values
Any value is allowed. 
Values including commas in them should replace the comma with a space.
viddefines the View to accessYes
institutiondefines the institution to be usedYes

Should include the search scope code as defined in the View Wizard on the Search Scopes page.

Note: In the View Wizard, the code is defined in the Name field.

A search scope can include multiple local scope values and/or MetaLib quick-sets and/or Primo Central.

The Front End will decode the search scope in the same way that it does it for a search entered in the Primo Front End. Only one 'search_scope' parameter is allowed per request. For example:


The deep-link will display the tab which is associated with the search scope. If the same search scope is used by several tabs and the 'tab' parameter is not included in the deep link, the system will display the first tab that includes the search scope. If a deep link specifies a search scope that is not defined for any tab, the system will display the first tab and the first search scope defined for the tab.

In earlier version the "loc" parameter was used, but in newer versions, we recommend using the search_scope instead.]

groupName of the user group. Relevant for restricted scopes.No
prefLangDefine the UI language, the purpose is to display the Primo front end in the requested interface language parameter Need to be set with the requested local for example: prefLang = en_USNo
locNOTE: This parameter is deprecated, use search_scope instead

Supports 3 different search targets: 

1) Local 
2) Deep Search 
3) Remote (Metalib) - If the results from a remote site are not in the MetaLib data format, Primo displays a link to the results in the Additional Results section, which appears first in the results. 

In order to add a target to search on, add the following template to the URL: 
loc=<target>,<location reference> 

<target> possible values: 

1) local - For a local search 
2) adaptor - For a deep search 
3) remote - For a remote search against Metalib 

<location reference> possible values: 

1) for local - define the scope to search on 
    Example: loc=local,scope:(VOLCANO)
2) for adaptor - need to define the name of the requested adaptor 
    Example: loc=adaptor,primo_central_multiple_fe
3) for remote - need to define a quick set name 
    Example: loc=remote,Business and Sciences

A single request will let you define as many search targets as you want, meaning, all 3 can be done in a single request. 

Example for single search target: 

http ://il-primo03:1702/PrimoWebServices/xservice/search/brief?institution=PRIMO&query=any,contains,book&indx=20&bulkSize=10&loc=local,scope:(VOLCANO) 
Example for multi search (two)  targets: 

http ://il-primo03:1702/PrimoWebServices/xservice/search/brief?institution=PRIMO&query=any,contains,book&indx=20&bulkSize=10&loc=local,scope:(VOLCANO)&loc=adaptor,primo_central_multiple_fe 

Example for multi search (three)  targets: 

http ://il-primo03:1702/PrimoWebServices/xservice/search/brief?institution=PRIMO&query=any,contains,book&indx=20&bulkSize=10&loc=local,scope:(VOLCANO)&loc=adaptor,primo_central_multiple_fe&loc=remote,Business and Sciences 

Multiple scopes 
You can search multiple scopes in 2 ways: 
1) loc=local,scope:(VOLCANO,NORTH)
2) Use multiple loc parameters: 
There is a limitation to the order and which scopes can be used in such queries. 
The limitation is according to the "Search Scopes" you have defined for each view. 
To be sure what your "Search scopes" are, you can view the following file on your FE machine: 

under the <filters> tag you will find all your configured search scopes: 
        <filter>facet_frbrtype:(7 OR 6)</filter> 
        <filter>NOT scope:("PRIMO")</filter> 
        <filter>scope:(NORTH)  OR scope:(demo_digitool) OR scope:("CENTRAL")</filter> 
You are allowed to use only those scopes listed in the file and only use the order as in the file. 
Mixing the order will not work, so &loc=local,scope:(NORTH, demo_digitool, "CENTRAL") will work but &loc=local,scope:( demo_digitool, NORTH,"CENTRAL") will not!
Searching against Primo Central 
Searching against Primo Central is done via an adaptor. 
Therefor as mentioned above, you will need to add the following: 

Display the relevant tab.


According to the tab code configured in the view wizard

NOTE: the value sent, must be in lower case, even if the code contains upper case letters.

indxThe position number of the record to begin from when retrieving the results
(For example, in order to display page #2, we want to set indx=11, meaning start retrieving records from position 11 in the result set)
bulkSizeThe amount of records to retrieve from the position set for indx (In order to display page #2 when we display 10 records in a page:
srtSee the XServices for complete documentation.

Specifies the type of sort to perform. If this parameter is not specified or left empty, the system uses the relevance sort. In addition to the relevance sort, Primo supports the following types of sorts:
  • stitle - performs a title sort. 
  • scdate - performs a date sort in descending order. 
  • scdate2 - performs a date sort in ascending order.
  • screator - performs an author sort. 
  • popularity - performs a popularity sort. 

The valid values for this parameter are defined with the Index Field column in the Sort Fields Config mapping table. The direction of the sort is defined with the Direction column.
query (dr_s
and  dr_e)

The date range query allows you to filter your search with a data range, which is similar to the functionality provided by the date widget in the advanced search:

Use the following format to specify either a start and end range, a start date only, or an end date only:


For example:

NOTE: You must also specify a search query. For more information, see the query parameter above.

highlight + displayFieldYou can define to "highlight" the search term you have requested in the retrieved results. 
(Below, highlighting the title when searching for the term: "book") 


Indication whether highlights by server is required. 
Possible values: true or false 
Default: false 

If highlight=true, you must specify one or more displayField parameters to indicate which fields to highlight. 

defines in which field from the Display section of the PNX to highlight, if it contains the search term. 
Possible values: PNX field names from the Display section. 
You can define more than 1 displayField: 

NOTE: the highlighting is done by wrapping the relevant section in the PNX with a <span> tag, 
i.e. <span class="searchword">BOOK</span>
pcAvailabiltyModeIndicates whether PC records that do not contain full text are displayed in the search results. By default, Primo displays only records that contain full text. If you set this parameter to true all PC records will display. The valid values are true and false (default).

NOTE: If the Include Results with no full-text option is selected in the Views Wizard (Primo Home > Ongoing Configuration Wizards > Views Wizard), the Expand My Results option will be disabled in the Front End. Users will have to select the Full Text Online facet to display PC records that have full text only.



In order to query the date facet using between values:



Input Example



Output Example