我有 3000 多本书,有些有 ISBN 编号,有些没有。我正在尝试使用 Google API 搜索查询从 JSON 文件中获取他们的缩略图(可能是字幕和作者)。
我注意到每个搜索查询都会产生不同的 JSON 文件——这正常吗?VolumeID 查询似乎返回了更详细的 JSON?我在下面包含了相关的 JSON 文件。
设置 = Win7、本地主机、apache、php、chrome。
isbn: 查询:
https://www.googleapis.com/books/v1/volumes?q=isbn:0716604892
它返回以下 JSON;
{
"kind": "books#volumes",
"totalItems": 1,
"items": [
{
"kind": "books#volume",
"id": "beSP5CCpiGUC",
"etag": "cNL3l6PTv24",
"selfLink": "https://www.googleapis.com/books/v1/volumes/beSP5CCpiGUC",
"volumeInfo": {
"title": "The 1989 World Book year book",
"subtitle": "a review of the events of 1988 ; the annual supplement to the World book encyclopedia",
"authors": [
"Robert O. Zeleny"
],
"publishedDate": "1989-02-01",
"industryIdentifiers": [
{
"type": "ISBN_10",
"identifier": "0716604892"
},
{
"type": "ISBN_13",
"identifier": "9780716604891"
}
],
"readingModes": {
"text": false,
"image": false
},
"pageCount": 576,
"printType": "BOOK",
"categories": [
"Reference"
],
"contentVersion": "preview-1.0.0",
"imageLinks": {
"smallThumbnail": "http://bks8.books.google.co.uk/books?id=beSP5CCpiGUC&printsec=frontcover&img=1&zoom=5&source=gbs_api",
"thumbnail": "http://bks8.books.google.co.uk/books?id=beSP5CCpiGUC&printsec=frontcover&img=1&zoom=1&source=gbs_api"
},
"language": "en",
"previewLink": "http://books.google.co.uk/books?id=beSP5CCpiGUC&dq=isbn:0716604892&hl=&cd=1&source=gbs_api",
"infoLink": "http://books.google.co.uk/books?id=beSP5CCpiGUC&dq=isbn:0716604892&hl=&source=gbs_api",
"canonicalVolumeLink": "http://books.google.co.uk/books/about/The_1989_World_Book_year_book.html?hl=&id=beSP5CCpiGUC"
},
"saleInfo": {
"country": "GB",
"saleability": "NOT_FOR_SALE",
"isEbook": false
},
"accessInfo": {
"country": "GB",
"viewability": "NO_PAGES",
"embeddable": false,
"publicDomain": false,
"textToSpeechPermission": "ALLOWED",
"epub": {
"isAvailable": false
},
"pdf": {
"isAvailable": false
},
"webReaderLink": "http://books.google.co.uk/books/reader?id=beSP5CCpiGUC&hl=&printsec=frontcover&output=reader&source=gbs_api",
"accessViewStatus": "NONE",
"quoteSharingAllowed": false
}
}
]
}
volumeId 查询;
https://www.googleapis.com/books/v1/volumes/beSP5CCpiGUC
我得到以下 JSON;
{
"kind": "books#volume",
"id": "beSP5CCpiGUC",
"etag": "Zx4P5cYhhLU",
"selfLink": "https://www.googleapis.com/books/v1/volumes/beSP5CCpiGUC",
"volumeInfo": {
"title": "The 1989 World Book year book",
"subtitle": "a review of the events of 1988 ; the annual supplement to the World book encyclopedia",
"authors": [
"Robert O. Zeleny"
],
"publisher": "World Book",
"publishedDate": "1989-02-01",
"industryIdentifiers": [
{
"type": "ISBN_10",
"identifier": "0716604892"
},
{
"type": "ISBN_13",
"identifier": "9780716604891"
}
],
"readingModes": {
"text": false,
"image": false
},
"pageCount": 576,
"printedPageCount": 584,
"dimensions": {
"height": "26.00 cm"
},
"printType": "BOOK",
"categories": [
"Encyclopedias and dictionaries",
"History",
"Yearbooks",
"Reference / Yearbooks & Annuals"
],
"contentVersion": "preview-1.0.0",
"imageLinks": {
"smallThumbnail": "http://bks8.books.google.co.uk/books?id=beSP5CCpiGUC&printsec=frontcover&img=1&zoom=5&imgtk=AFLRE736tSIRMcPp77lZYXBvTtzig6KA5oP0RmH9_4--kTDCuQzvlcknopkOZgyLzBFI_hPMd-6MJTcEO-VZZDFzeDCDkjdsiQ&source=gbs_api",
"thumbnail": "http://bks8.books.google.co.uk/books?id=beSP5CCpiGUC&printsec=frontcover&img=1&zoom=1&imgtk=AFLRE72NzXnCEhmuPOXXn9VNNBgc-uC37bUnfBkbN25dnVcmdSU8Y3E8rNQNCj7Im_YVWH2RXFeqdQ2tengtOsgCjSJh06Oypg&source=gbs_api",
"small": "http://bks8.books.google.co.uk/books?id=beSP5CCpiGUC&printsec=frontcover&img=1&zoom=2&imgtk=AFLRE73COelJADcztpk28bKnJ4GQP7Nn7ScPgUbyk90mt25jpcuoU-cDZD--gj9j3jwutTtkTu6bzVouAdjLxi-sy0AN35bD7A&source=gbs_api",
"medium": "http://bks8.books.google.co.uk/books?id=beSP5CCpiGUC&printsec=frontcover&img=1&zoom=3&imgtk=AFLRE73oXHyjFepDB-fitily_UF8UmnKZMrTes6ZVsa576_LNl5wczwkJmW6mv_4RK2_nExpPft8N72BXJ7WUzsGwDLCq-5rEw&source=gbs_api",
"large": "http://bks8.books.google.co.uk/books?id=beSP5CCpiGUC&printsec=frontcover&img=1&zoom=4&imgtk=AFLRE71psAjJeg1UFlkqIbh-5IiHVNYPmZW9bb9IQjps23zPD-TlXqQ6RGeVRUMPqYpSVWcYwY8zQnwNITxWLBqp_zgMzpMiYw&source=gbs_api",
"extraLarge": "http://bks8.books.google.co.uk/books?id=beSP5CCpiGUC&printsec=frontcover&img=1&zoom=6&imgtk=AFLRE70VKrBxxv8Q2Ltr3qhAwh3UMx3d3tv2r2bzwXvlu10_KpyA1TuM0_6RiIEkBe4ENHT21EH_xzPQBe7LWRBgU1IhozIoNQ&source=gbs_api"
},
"language": "en",
"previewLink": "http://books.google.co.uk/books?id=beSP5CCpiGUC&hl=&source=gbs_api",
"infoLink": "http://books.google.co.uk/books?id=beSP5CCpiGUC&hl=&source=gbs_api",
"canonicalVolumeLink": "http://books.google.co.uk/books/about/The_1989_World_Book_year_book.html?hl=&id=beSP5CCpiGUC"
},
"saleInfo": {
"country": "GB",
"saleability": "NOT_FOR_SALE",
"isEbook": false
},
"accessInfo": {
"country": "GB",
"viewability": "NO_PAGES",
"embeddable": false,
"publicDomain": false,
"textToSpeechPermission": "ALLOWED",
"epub": {
"isAvailable": false
},
"pdf": {
"isAvailable": false
},
"webReaderLink": "http://books.google.co.uk/books/reader?id=beSP5CCpiGUC&hl=&printsec=frontcover&output=reader&source=gbs_api",
"accessViewStatus": "NONE",
"quoteSharingAllowed": false
}
}
欢迎任何建议,如果有更好或更有效的检索缩略图/信息的方法,请告诉我,因为这是一个个人开发项目,我愿意学习。
如有必要,我可以提供我当前的代码。