{"_id":"59121415fecdb90f003580e2","category":{"_id":"5792a0baf967f617000d9e77","project":"56d55013075dfa0b00be98e6","__v":0,"version":"56d55014075dfa0b00be98e9","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-07-22T22:39:54.708Z","from_sync":false,"order":3,"slug":"books","title":"Books"},"project":"56d55013075dfa0b00be98e6","__v":0,"user":"573cb45cced73c20002cf5a2","version":{"_id":"56d55014075dfa0b00be98e9","__v":16,"project":"56d55013075dfa0b00be98e6","createdAt":"2016-03-01T08:17:24.051Z","releaseDate":"2016-03-01T08:17:24.051Z","categories":["56d55014075dfa0b00be98ea","56d55036c8c687150071efb3","56d55094b939870b005129e2","56d550ae5acf9f0b00f735d0","56d5537ac8c687150071efbf","573cae191000320e00918252","573cbe15f320ae29009dbd94","5792a0baf967f617000d9e77","5792a0c023106419009c4302","58093f2994bc150f00f2fe47","580940f33c22790f00fd1e98","58094c01e5998d0f00d29b5d","58101442c03f0b0f0097f099","581020f07c59d72500b85add","581032c708d8050f00948d2a","5810e6ca08d8050f00948dcf"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Archy","version_clean":"1.0.0","version":"1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-05-09T19:10:13.638Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":999,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Book availability JSON API\"\n}\n[/block]\nBook availability can be queried by either its `ISBN` or `ASIN`. There are plans to also support `title`.\n\nEither an ASIN or ISBN can be submitted for the `isbn` key. The API will detect whether the value is an ASIN or an ISBN.\n\nWhen the API request if received by the IA server, the server is looking for different identifiers that may be related to the queried identifier, for example: related ISBNs or ASINs, related items that exist in IA’s collections, etc.\n\nBased on the data that the IA has on these related items, it calculates an response status and responds with the following fields:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  status: \\\"ok\\\",\\n  response: 3,\\n  message: \\\"we have already scanned this book, but need another physical copy for ourselves\\\",\\n  ia_identifiers: \\n    {\\n      ia_identifier: \\\"lorem00ipsum\\\",\\n      score: 1\\n    },\\n  response_time: 0.1064\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Typical Response\"\n    }\n  ]\n}\n[/block]\n**status**\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Value\",\n    \"h-1\": \"Information\",\n    \"0-0\": \"OK\",\n    \"0-1\": \"The input string seems to be valid\",\n    \"1-0\": \"Error\",\n    \"1-1\": \"There's an error with the input string or the service\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n**response/message**\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Response\",\n    \"h-1\": \"Message\",\n    \"0-0\": \"-1\",\n    \"0-1\": \"invalid asin or isbn\",\n    \"1-0\": \"0\",\n    \"1-1\": \"we don't need this book\",\n    \"2-0\": \"1\",\n    \"2-1\": \"we need to scan this book\",\n    \"3-0\": \"2\",\n    \"3-1\": \"we have already scanned this book, but need another physical copy for a partner\",\n    \"4-0\": \"3\",\n    \"4-1\": \"we have already scanned this book, but need another physical copy for ourselves\"\n  },\n  \"cols\": 2,\n  \"rows\": 5\n}\n[/block]\n**ia_identifiers** - An array of globally unique IDs of items on archive.org that are related to the input (either have the same asin/isbn/oclc/lccn or have a related asin/isbn/oclc/lccn) \n**response time** - The time it took for IA’s server to generate the response\n**score** - 1 if the book is an exact match, 0.5 if it's a related match\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Debug Info\"\n}\n[/block]\nAdditional fields are returned when &debug=true is added to the end of the query\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\n{\\n  status: \\\"ok\\\",\\n  response: 3,\\n  message: \\\"we have already scanned this book, but need another physical copy for ourselves\\\",\\n  ia_identifiers: \\n    [\\n      ia_identifier: \\\"9783791535661\\\",\\n      score: 1\\n    ],\\n  books: \\n    {\\n      9783791535661: \\n        {\\n          metadata: \\n            {\\n              sort_status: \\\"NEED\\\",\\n              title: \\\"DWWIAPI4Dummies\\\",\\n              imagecount: \\\"1\\\",\\n              isbn: \\\"9783791535661\\\",\\n              identifier: \\\"DWNIAPI18R3\\\",\\n              mediatype: \\\"texts\\\",\\n              boxid: \\\"IA1234567\\\",\\n              creator: \\\"DWNI, API\\\",\\n              boxid_2: \\\"CH123456\\\",\\n              related-external-id:[ \\n                \\\"urn:isbn:3833722509\\\",\\n                \\\"urn:asin:276776144\\\",\\n                \\\"urn:oclc:723876752\\\",\\n                \\\"urn:lccn:836890281\\\"\\n              ]\\n            },\\n          scanned: true,\\n          china_has: true,\\n          need_second: true,\\n          in_transit: false\\n        }\\n    },\\n  china_wants: true,\\n  component_response_times: \\n    {\\n      search: 0.0531,\\n      china_wants: 0.0204,\\n      sort: 0.0001\\n    },\\n  query: \\\"mediatype:texts AND (isbn:TESTISBN00018 OR related-external-id:\\\"urn:isbn:TESTISBN00018\\\")\\\",\\n  response_time: 0.0749\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Response w/ Debug Info\"\n    }\n  ]\n}\n[/block]\n**books**  - contains further metadata and internal algorithm results about the items from  **ia_identifiers**\n**title** - the name of the item\n**imagecount** - number of scanned/uploaded image files that are associated to this book\n**isbn** - ISBN/ASIN that associated to this book\n**creator** - Writer/Illustrator/etc. that are related to this book\n**related-external-id** - if available, an array of other asin/isbn/oclc/lccn that are related to this book, available in urn format\n**boxid, boxid_2,sort_status** - information that’s related to a physical copy of the book, if available. Used to calculate the following fields, and consequently to calculate the **status/response/message** for the original query\n**query**  - the query that’s used internally by the IA system to create this response","excerpt":"The Book Do-We-Want-It (DWWI) API","slug":"book-do-we-want-it-dwwi-api","type":"basic","title":"Book Do-We-Want-It API"}

Book Do-We-Want-It API

The Book Do-We-Want-It (DWWI) API

[block:api-header] { "type": "basic", "title": "Book availability JSON API" } [/block] Book availability can be queried by either its `ISBN` or `ASIN`. There are plans to also support `title`. Either an ASIN or ISBN can be submitted for the `isbn` key. The API will detect whether the value is an ASIN or an ISBN. When the API request if received by the IA server, the server is looking for different identifiers that may be related to the queried identifier, for example: related ISBNs or ASINs, related items that exist in IA’s collections, etc. Based on the data that the IA has on these related items, it calculates an response status and responds with the following fields: [block:code] { "codes": [ { "code": "{\n status: \"ok\",\n response: 3,\n message: \"we have already scanned this book, but need another physical copy for ourselves\",\n ia_identifiers: \n {\n ia_identifier: \"lorem00ipsum\",\n score: 1\n },\n response_time: 0.1064\n}", "language": "json", "name": "Typical Response" } ] } [/block] **status** [block:parameters] { "data": { "h-0": "Value", "h-1": "Information", "0-0": "OK", "0-1": "The input string seems to be valid", "1-0": "Error", "1-1": "There's an error with the input string or the service" }, "cols": 2, "rows": 2 } [/block] **response/message** [block:parameters] { "data": { "h-0": "Response", "h-1": "Message", "0-0": "-1", "0-1": "invalid asin or isbn", "1-0": "0", "1-1": "we don't need this book", "2-0": "1", "2-1": "we need to scan this book", "3-0": "2", "3-1": "we have already scanned this book, but need another physical copy for a partner", "4-0": "3", "4-1": "we have already scanned this book, but need another physical copy for ourselves" }, "cols": 2, "rows": 5 } [/block] **ia_identifiers** - An array of globally unique IDs of items on archive.org that are related to the input (either have the same asin/isbn/oclc/lccn or have a related asin/isbn/oclc/lccn) **response time** - The time it took for IA’s server to generate the response **score** - 1 if the book is an exact match, 0.5 if it's a related match [block:api-header] { "type": "basic", "title": "Debug Info" } [/block] Additional fields are returned when &debug=true is added to the end of the query [block:code] { "codes": [ { "code": "\n{\n status: \"ok\",\n response: 3,\n message: \"we have already scanned this book, but need another physical copy for ourselves\",\n ia_identifiers: \n [\n ia_identifier: \"9783791535661\",\n score: 1\n ],\n books: \n {\n 9783791535661: \n {\n metadata: \n {\n sort_status: \"NEED\",\n title: \"DWWIAPI4Dummies\",\n imagecount: \"1\",\n isbn: \"9783791535661\",\n identifier: \"DWNIAPI18R3\",\n mediatype: \"texts\",\n boxid: \"IA1234567\",\n creator: \"DWNI, API\",\n boxid_2: \"CH123456\",\n related-external-id:[ \n \"urn:isbn:3833722509\",\n \"urn:asin:276776144\",\n \"urn:oclc:723876752\",\n \"urn:lccn:836890281\"\n ]\n },\n scanned: true,\n china_has: true,\n need_second: true,\n in_transit: false\n }\n },\n china_wants: true,\n component_response_times: \n {\n search: 0.0531,\n china_wants: 0.0204,\n sort: 0.0001\n },\n query: \"mediatype:texts AND (isbn:TESTISBN00018 OR related-external-id:\"urn:isbn:TESTISBN00018\")\",\n response_time: 0.0749\n}", "language": "json", "name": "Response w/ Debug Info" } ] } [/block] **books** - contains further metadata and internal algorithm results about the items from **ia_identifiers** **title** - the name of the item **imagecount** - number of scanned/uploaded image files that are associated to this book **isbn** - ISBN/ASIN that associated to this book **creator** - Writer/Illustrator/etc. that are related to this book **related-external-id** - if available, an array of other asin/isbn/oclc/lccn that are related to this book, available in urn format **boxid, boxid_2,sort_status** - information that’s related to a physical copy of the book, if available. Used to calculate the following fields, and consequently to calculate the **status/response/message** for the original query **query** - the query that’s used internally by the IA system to create this response