worldcat_api_classify_by: Search WorldCat classify API by ISBN, ISSN, or OCLC number

worldcat_api_classify_byR Documentation

Search WorldCat classify API by ISBN, ISSN, or OCLC number

Description

Access the results of a WorldCat classify API search by ISBN, ISSN, or OCLC number to get the most frequent call numbers (DDC and LCC) associated with a work. Returns a data.table with those call numbers and various other metadata. See "Details" for more information.

Usage

worldcat_api_classify_by_oclc(x, debug = FALSE)

worldcat_api_classify_by_isbn(x, debug = FALSE)

worldcat_api_classify_by_issn(x, debug = FALSE)

Arguments

x

A string representation of the standard number that the function chosen accepts.

debug

A logical indicating whether the HTTP and classify API responses should be printed (for debugging) (default is FALSE)

Details

The returned data.table contains fields for various pieces of metadata returned by the API request. These fields include the ISBN/ISSN/OCLC number used, title of work, author, total number of holdings, total number of electronic holdings, call number type, call number recommendation (by most popular), number of holdings using that call number, the HTTP status code, and the Classify API response code.

For each ISBN/ISSN/OCLC number used, two rows will be returned; one for the DDC and one for the LCC. Common information (work metadata) will the the same in both rows. If one of the call numbers is missing, the recommendation and holdings fields will be NA.

The API can be persnickety, and there are many things that can go wrong. For example, the API can respond with multiple works for a single standard number (ISBN 9780900565748, for example). If this happens, no attempt is made to follow one of the results, and the returned data.table will return no useful information.

If the http_status_code is 200 and the classify_response_code is 0, you've received good results.If the classify_response_code is 4, the standard number may have returned multiple works.

The http_status_code should never not be 200.

If something went wrong (for example, the status/response codes are not 200 and 0, respectively), you may want to re-run the function call with print.api.responses set to TRUE. This will print the HTTP status code and the raw XML text response from the API.

As with all API access functions in this package, it's up to the user to limit their API usage so as to not get blocked. These functions are deliberately not vectorized for this reason; they only accept one standard number at a time.

Final note: all of these API functions seem to work better with OCLC numbers than any other standard number. If multiple standard numbers are available, using the OCLC number is always preferred.

Value

A data.table with most popular DDC and LCC call numbers and various other metadata. See "Details" for more information.

Examples


## Not run: 
  worldcat_api_classify_by_oclc("93976650")
   #         oclc   title           author total_holdings total_eholdings call_type
   #       <char>  <char>           <char>          <int>           <int>    <char>
   # 1: 939766505 Lobster King, Richard J.            244             534       DDC
   # 2: 939766505 Lobster King, Richard J.            244             534       LCC
   #    recommendation holdings http_status_code classify_response_code
   #            <char>   <char>            <int>                  <int>
   # 1:        641.395      767              200                      0
   # 2:      QL444.M33      318              200                      0


## End(Not run)


libbib documentation built on Nov. 10, 2022, 6:16 p.m.