OCLC Developer Network

OpenSearch

Two search query formats are available with an OpenSearch request, keyword and  CQL.

OpenSearch Keyword

The simplest form of an OpenSearch request is:
http://www.worldcat.org/webservices/catalog/search/opensearch?q=[search terms]&wskey=[your key]

The complete pattern for an OpenSearch Keyword searcg request is:
http://worldcat.org/webservices/catalog/search/opensearch?q=[query]&format=[atom|rss]&start=[start position]&count=[maximum number of records to return]&cformat=[citation format]&wskey=[your key]

Only the query value "q" is required. Queries are sent as strings of keywords. All other values are optional. The default values are: format=atom, cformat=mla, start=1, count=10.

The valid citation format values for the cformat field are apa, chicago, harvard, mla, turabian, or all.  All provides all the types of citation formats listed.  If a valid cformat value is not included in the request, a formatted citation is not supplied by default in the response. For more details, see the following notes about requesting formatted citations.

The only type of index available with the OpenSearch Keyword search is called the "Keyword" index.  It is also used in FirstSearch WorldCat.  The Keyword index includes the following information from the bibliographic record: ISBN, author, title, notes, subjects, dates of publication, and some map information.

Some examples of an OpenSearch Keyword Search

A search for civil war, returning a result with the default Atom format, starting position, and count:
http://www.worldcat.org/webservices/catalog/search/opensearch?q=civil%20war&wskey=[key]

A search for civil war, returning a result in the RSS format, starting at position 6, with a count of 5 records:
http://www.worldcat.org/webservices/catalog/search/opensearch?q=civil%20war&format=rss&start=6&count=5&wskey=[key]

A search for civil war, returning a result in the Atom format, including an MLA-formatted citation for each record:
http://www.worldcat.org/webservices/catalog/search/opensearch?q=civil%20war&format=atom&cformat=mla&wskey=[key]

OpenSearch CQL

CQL queries using SRU indexes can be used in an OpenSearch request. Help with constructing CQL queries can be found:

The complete pattern for anOpenSearch CQLrequest is:
http://worldcat.org/webservices/catalog/search/opensearch?q=[query]&format=[atom|rss]&start=[start position]&count=[maximum number of records to return]&cformat=[citation format]&wskey=[your key]

An example of an OpenSearch CQL query of all scores wit the title including the words Jazz patterns:
http://www.worldcat.org/webservices/catalog/search/opensearch?q=srw.ti+all+%22jazz+patterns%22+and+srw.dt+any+%22sco%22&wskey=[key
]

And an example of the above OpenSearch CQL query also limited to only records held by 5 or more libraries.  (Note the Library holdings group index with search value 05 requires the service level be set to full):
http://www.worldcat.org/webservices/catalog/search/opensearch?q=srw.ti+all+%22jazz+patterns%22+and+srw.dt+any+%22sco%22+and+srw.cg.+any+%2205%22&servicelevel=full&wskey=[key
]

 

When using an OpenSearch CQL query, please be sure to also consider the impact of FRBR Grouping and Service Level when determining the meaning of the results.

FRBR Grouping

Note: the default option is to present a single representativerecord for a work that may be represented by multiple editions.  This is sometimes referred to as a "FRBRized" result set, as the record clustering algorithm is based on the FRBR(Functional Requirements for Bibliographic Records) model, and it prevents records for different editions, and that may appear to be duplicates to some users and for most discovery applications, from swamping the search result.  To see every record for every edition and variation available, include the parameter frbrGrouping=off.

Service Level

Note: the indexes available and the data retrieved will be impacted by what Service Level is used. 

  • If no service level is given the indexes and data will be provided at the default level. This level can be used for any users without the user being authenticated as a library user.  However, only indexes valid as default level indexes and limits will be able to function.
  • If the data will be used only by authenticated users [library staff, patrons, faculty, students, and people within the library building} then the full service level can be used for more options and more data.  All indexes and limits function at the full service level.

Navigation for all types of OpenSearch requests

You can navigate through the result sets using the start and count parameters. The default is to start at the first record and to present 10 records. The maximum number of records is 100 records.

Sample responses

Sample RSS response
Sample Atom response

Follow the OCLC Developer Network:

The OCLC Developer Network supports the use of OCLC Web Services—a set of tools and APIs that expose data and services for WorldCat and our member libraries and partner institutions or companies. learn more »

© 2010 OCLC Domestic and international trademarks and/or service marks of OCLC Online Computer Library Center, Inc. and its affiliates


Powered by Drupal, an open source content management system