Building a query
A URL query used to access the WorldCat Knowledge Base API can be broken down into three groupings:
The query and associated parameters follow the OpenURL standard with the following caveats:
Response Format:
By default, the response format is set to JSON, however, using the OpenURL ServiceType entity, XML can also be requested as a response type. To invoke the different response types the following key-value pairs can be used:
svc_id=json
or
svc_id=xml
Internal Search Parameters:
Included in this release are internal search parameters used to limit search scope to a particular library or collection. These are not included in the OpenURL specifications and should be considered extensions. They include:
rft.provider_uid rft.collection_uid rft.content rft.institution_id
Resolving multiple queries at the same time
A JSON only version of multiple OpenURLs in one request/response is now available. Using the new openurl/mresolve address a JSON formatted set of queries can be sent with a single request. A single response will be returned containing the results for all of the different queries. Using this version of the API allows a client to cut down on the HTTP traffic between their system and the KB API when issuing many queries at once. To send multiple queries, they need to be serialized into a json object. Ex:
{"q1":{"rft_id":"info:pmid/17014720"},"q2":{"rft.issn":"0028-0836"}}
To use the mutiple resolve function please use mresolve instead of resolve as the method endpoint.
Examples
For the following example we will be using the OCLC Training & Testing symbol whose OCLC symbol is TRN and whose registry ID is 105357 (http://worldcat.org/registry/Institutions/105357). We will also be using a specific citation for an article titled, Nature's Choices, found in Nature, 2010 Feb 18; 463(7283): 850 (http://www.worldcat.org/title/natures-choices/oclc/588264763&referer=brief_results).
Using http://worldcat.org/webservices/kb/openurl/resolve as the API endpoint we can then craft the following request (line breaks inserted for readability):
http://worldcat.org/webservices/kb/openurl/resolve? rft.title=Nature &rft.issn=0028-0836 &rft.oclcnum=1586310 &rft.date=2010-02-18 &rft.volume=463 &rft.issue=7283 &rft.spage=850 &rft.atitle=Nature's+choices &svc_id=json &rft.content=fulltext &rft.institution_id=105357 &rfr_id=info/sid:library.edu/DEMO &wskey=TjBKm4f7QdZwx //NOT A VALID KEY
Journal/book level information:
In order for a search to succeed, at least one of these is required:
Parameter | Definition | Notes |
|---|---|---|
rft.title | Journal or book title | Optional |
rft.issn | ISSN | Optional - can be comma delimited values to send more than one identifier per reqeust. |
rft.eissn | e-ISSN | Optional |
rft.isbn | ISBN | Optional - can be comma delimited values to send more than one identifier per reqeust. |
rft.oclcnum | OCLC number | Journal level OCLC number - optional. Can be comma delimited values to send more than one identifier per reqeust. |
As with all of the KB parameters, all information should be present if it is available. Based on the citation found in WorldCat.org, here are the values for the fields we will be sending:
Parameter | Value | Notes |
|---|---|---|
rft.title | Nature | |
rft.issn | 0028-0836 | From the 'Details' tab on the article page in WorldCat.org |
rft.eissn |
| |
rft.isbn | This request is for an article in a journal, so there is no ISBN. | |
rft.oclcnum | 1586310 | Click 'Nature' in the citation and copy the resulting OCLC number. |
Article level information:
Article level information is used to identify a specific article within the journal. Most fields are not used directly by the API, but may be used to formulate an article link to give to the user.
Parameter | Definition | Notes |
|---|---|---|
rft.date | Publication date | Optional, this will be used to filter out records that do not contain this date. Dates must be in the format YYYY, YYYY-MM, or YYYY-MM-DD |
rft.volume | Journal volume | Optional, this will be used to filter out records that do not contain this volume. Volumes should be expressed as numbers only. |
rft.issue | Journal issue | Optional, this will be used to filter along with volume. Issues should be expressed as numbers only. |
rft.spage | Start page | Optional |
rft.atitle | Article title | Optional |
rft.aulast | First author's last name | Optional |
Just as we did with the journal level information, we will put values into these field whenever they are present in the citation:
Parameter | Value | Notes |
|---|---|---|
rft.date | 2010-02-18 | "2010 Feb 18" translated into the appropriate format. |
rft.volume | 463 | |
rft.issue | 7283 | |
rft.spage | 850 | |
rft.atitle | Nature's+choices | URL encoded article title |
rft.aulast | No author appears on the citation. |
WorldCat Knowledge Base API specific commands/filters:
These are control fields that can be used to send additional information or filter commands to KB. They should be chosen based on the type of query being done.
Parameter | Definition | Notes |
|---|---|---|
svc_id | Select response format; possible values are: json and xml | Defaults to json |
rft.provider_uid | Provider uid as defined by knowledge base | Optional |
rft.collection_uid | Collection uid as defined by knowledge base | Optional |
rft.content | Indicator to select records of a specific content type; possible values are: fulltext, selectedft, abstracts, indexed, print, and ebook. Can be comma delimited values to send more than one identifier per reqeust. | Defaults to fulltext |
rft.institution_id | Library's worldcat registry ID | Optional |
rft.jkey | Publisher's identifier for a journal | Optional |
rft.openaccess | Open access flag; possible values are: none, yes, no. 'none' does not filter by the openaccess flag | Optional |
rfr_id |
A standard OpenURL referrer identifier. It is used by clients to self identify similar to a User-Agent for HTTP requests. The format is: info/sid:<hostname>/<application_id> ex: info/sid:xyz.edu/OPAC | For example: WCRS uses info/sid:oclc.org/WCRS. |
wskey | The WSKey for the client making the query (connected to a particular institution) | Required for external requests |
For these fields, we must choose which make sense for the type of query we are doing.
Parameter | Value | Notes |
|---|---|---|
svc_id | json | We want to receive results in json format |
rft.provider_uid | We do not want to limit by provider, so this is blank. | |
rft.collection_uid | We do not want to limit by collection, so this is blank. | |
rft.content | fulltext | We only want to see 'fulltext' type holdings (where the full article is available) |
rft.institution_id | 105357 | This is the institution we are using for this example |
rft.jkey | This is not known | |
rft.openaccess | we do not want to limit to only open access content, so this is blank. | |
rfr_id | info/sid:library.edu/DEMO | Create a rfr_id value that identifies the client |
wskey | TjBKm4f7QdZwx | This is not a valid wskey. |
WorldCat Knowledge Base API OpenURL Parameters:
Parameter | Definition | Notes |
|---|---|---|
rft.id=info:doi... | Query by DOI | A DOI lookup will be done and result will be used to augment other query params |
rft.id=info:pmid... | Query by PMID | A PMID lookup will be done and result will be used to augment other query params |
rft.force_remote_lookup | Force PMID/DOI lookup | Normal behavior for DOI/PMID lookups is to only query when metadata is lacking. Setting rft.force_remote_lookup to 'yes' will make the lookup happen regardless of other metadata |
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
Follow the OCLC Developer Network: