Examples:
Example responses for each of the four base resources provided by the WorldCat Knowledge Base REST API can be found on the following detail pages:
Below is an example that demonstrates the difference between an XML and a JSON request.
XML vs. JSON:
Following is an example of a XML response for the query:
http://worldcat.org/webservices/kb/rest/collections/NPG.journals?wskey=...
which yields the following response:
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:kb="http://worldcat.org/kb"> <title type="text">Nature Publishing Group</title> <id> http://worldcat.org/webservices/kb/rest/collections/NPG.journals </id> <link href="http://worldcat.org/webservices/kb/rest/collections/NPG.journals" rel="self"/> <kb:provider_uid>NPG</kb:provider_uid> <kb:provider_name>Nature Publishing Group</kb:provider_name> <kb:collection_uid>NPG.journals</kb:collection_uid> <kb:owner_institution>6569</kb:owner_institution> <kb:source_institution>6569</kb:source_institution> <kb:status>raw</kb:status> <kb:dbkey/> <link href="http://www.nature.com" rel="via"/> <kb:linkscheme>npg</kb:linkscheme> <kb:extra_link_params/> <kb:open>true</kb:open> <kb:ext>#Mon Oct 03 10:07:17 EDT 2011</kb:ext> <kb:available_entries>93</kb:available_entries> <kb:selected_entries>93</kb:selected_entries> <kb:collection_uid>NPG.journals</kb:collection_uid> </entry>
And this is the same query with JSON selected as the output:
http://worldcat.org/webservices/kb/rest/collections/NPG.journals?alt=json&wskey=...
returning:
{
"provider_uid": "NPG",
"provider_name": "Nature Publishing Group",
"collection_uid": "NPG.journals",
"name": "Nature Publishing Group",
"url": "http://www.nature.com",
"linkscheme": "npg",
"status": "raw",
"open": true,
"collType": [
"browsable"
],
"ownerInstitutionId": "6569",
"sourceInstitutionId": "6569",
"extraLinkParams": "",
"availableEntries": 93,
"selectedEntries": 93,
"extensions": "#Mon Oct 03 10:23:39 EDT 2011\n"
}
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: