OCLC Developer Network

Using the API

Summary

This Web Service uses autocomplete style searching of FAST Authorized and See Also Headings, returning the Authorized Heading and associated information needed to enter it into a cataloging interface.

Please note: The API expects all requests to be UTF-8 encoded. Responses are also UTF-8 encoded.

 

Access methods

REST is the simplest format to use and the only request format currently supported. REST requests consist of URLs that can be invoked either via HTTP POST or GET methods, either programatically or via a WEB browser. For example:

http://fast.oclc.org/searchfast/fastsuggest?&query=[query]&queryIndex=[queryIndex]&queryReturn=[queryReturn]&suggest=autosuggest&rows=[numRows]&callback=[callbackFunction]

where:

parameterdescription
queryThe query to search
queryIndex

The index corresponding to the FAST facet. These include

namedescription
suggestallAll facets
suggest00Personal names
suggest10Corporate names
sugget11Event
suggest30Uniform title
suggest50Topical
suggest51Geographic names
suggest55Form/Genre
queryReturn

Information requested list, comma separated. These include:

namesdescription
idrootFAST Number
authAuthorized Heading, formatted for display with -- as subfield separator
typealt or auth - indicates whether the match on the queryIndex was to an Authorized or See Also heading
tagMARC Authority tag number for the heading - 100= Personal name, 150 = Topical, etc.
rawAuthorized Heading, with subfield indicators. Blank if this is identical to auth (i.e. no subfields)
breakerAuthorized Heading in marcbreaker format. Blank if this is identical to raw (i.e. no diacritics)
indicatorIndicator 1 from the Authorized Heading
numRowsheadings to return maximum restricted to 20 
callbackthe callback function name for jsonp

 

Example Response:

http://fast.oclc.org/searchfast/fastsuggest?&query=hog&queryIndex=suggestall&queryReturn=suggestall%2Cidroot%2Cauth%2Ctag%2Ctype%2Craw%2Cbreaker%2Cindicator&suggest=autoSubject&rows=3&callback=testcall

yields the following response:

testcall({
 "responseHeader":{
  "status":0,
  "QTime":1,
  "params":{
	"json.wrf":"testcall",
	"fl":"suggestall,idroot,auth,tag,type,raw,breaker,indicator",
	"q":"suggestall:hog",
	"rows":"3"}},
 "response":{"numFound":986,"start":0,"docs":[
	{
	 "idroot":"fst01140419",
	 "tag":150,
	 "indicator":" ",
	 "type":"alt",
	 "suggestall":"Hogs",
	 "auth":"Swine",
	 "raw":"",
	 "breaker":""},
	{
	 "idroot":"fst01140470",
	 "tag":150,
	 "indicator":" ",
	 "type":"alt",
	 "suggestall":"Hog houses",
	 "auth":"Swine--Housing",
	 "raw":"Swine$xHousing",
	 "breaker":""},
	{
	 "idroot":"fst00061534",
	 "tag":100,
	 "indicator":"1",
	 "type":"auth",
	 "suggestall":"Hogarth, William, 1697-1764",
	 "auth":"Hogarth, William, 1697-1764",
	 "raw":"Hogarth, William,$d1697-1764",
	 "breaker":""}]
 }})	

The first response heading is the Use For heading Hogs which has the Authorized heading Swine. The second is the Use For heading for Hog houses, which has the Authorized heading Swine--Housing. This Authorized heading is also given in its raw form including the $x subfield separator, which is unnecessary for the first heading. The third response matches the Authorized heading for Hogarth, William, 1697-1764, which is also given in its raw form.

More Information

A sample "how to "search and jQuery javascript processing code are provided here for use with this API. 

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