Skip to main content
Back to Standards
Search/Retrieve via URL logo

Search/Retrieve via URL

SRU

A web-service protocol that provides a standard way to search databases and retrieve records over HTTP. SRU uses the Contextual Query Language (CQL) for queries and returns results as XML. Developed by the Library of Congress as a modern, web-friendly successor to Z39.50, SRU has been adopted by OASIS as a standard. It is widely used in library union catalogs, federated search systems, and cross-institutional resource discovery.

Overview

Search/Retrieve via URL (SRU) is a web-service protocol that provides a standardized way to search databases and retrieve records over HTTP. Developed by the Library of Congress as a modern, web-friendly evolution of the Z39.50 protocol, SRU has become a key interoperability standard for library systems, union catalogs, and federated search environments. It uses the Contextual Query Language (CQL) for queries and returns structured XML responses.

Background

SRU was developed in the early 2000s by the Library of Congress and the Z39.50 community to address the limitations of Z39.50 in a web-centric world. While Z39.50 was a powerful protocol for information retrieval, it operated over a proprietary binary connection and was difficult to implement in web applications. SRU reimagined the same search-and-retrieve functionality using standard web technologies: HTTP for transport, URLs for request encoding, CQL for query syntax, and XML for response formatting. The protocol was initially developed alongside SRW (Search/Retrieve via Web services), which used SOAP instead of plain HTTP. Over time, SRU's simpler REST-like approach proved more popular. OASIS subsequently adopted SRU as a standard, and the Library of Congress continues to maintain and publish the specification.

Purpose & Scope

SRU enables clients to search remote databases and retrieve records using simple HTTP requests. A typical SRU interaction involves:

  1. Explain -- The client requests a description of the server's capabilities, available indexes, and supported record schemas.
  2. SearchRetrieve -- The client sends a CQL query and receives matching records in an XML response.
  3. Scan -- The client browses available index terms for query construction.

SRU supports multiple record schemas in responses, allowing servers to return records in formats such as Dublin Core, MARCXML, or MODS depending on client preference.

Key Elements / Properties

SRU requests are structured as HTTP GET requests with the following key parameters:

Parameter Description
operation The SRU operation: searchRetrieve, explain, or scan
query CQL query string
recordSchema Desired schema for returned records
maximumRecords Maximum number of records to return
startRecord Offset into the result set
sortKeys Sorting specification for results
recordPacking How records are packaged (XML or string)

SRU responses are XML documents containing a result set count, diagnostic information, and the requested records.

Serializations & Technical Formats

SRU requests are URL-encoded HTTP GET parameters. Responses are XML documents conforming to the SRU response schema. The protocol supports returning records in any XML-based metadata format, with Dublin Core and MARCXML being the most common. SRW provides an alternative SOAP-based transport for the same query and response semantics.

Governance & Maintenance

SRU is maintained by the Library of Congress, which publishes the specification and supporting documentation. OASIS has also standardized SRU through its Search Web Services Technical Committee. The specification has gone through several versions (1.1, 1.2, 2.0), with each version refining the protocol's capabilities. The SRU maintenance community includes representatives from national libraries, OCLC, and academic institutions.

Notable Implementations

SRU is implemented by the Library of Congress, the British Library, the Deutsche Nationalbibliothek, OCLC (WorldCat search), and many other national and academic library systems. The protocol is used in federated search middleware that queries multiple library catalogs simultaneously. Open-source implementations exist for multiple platforms, including YAZ (C library and toolkit), SRUServer (Java), and various Python and PHP implementations. The Gateway to Library Catalogs (Z39.50/SRU) at the Library of Congress provides a public SRU endpoint.

Related Standards

  • CQL (Contextual Query Language) -- The query language used by SRU for expressing search queries.
  • Z39.50 -- The predecessor protocol that SRU was designed to modernize for the web.
  • SRW (Search/Retrieve via Web services) -- The SOAP-based sibling protocol to SRU.
  • OpenSearch -- Another protocol for search results syndication, simpler than SRU but less expressive.
  • MARCXML -- A common record format returned by SRU servers in library contexts.

Further Reading