Google Books API - Book Details not Returned

别说谁变了你拦得住时间么 提交于 2020-01-05 04:14:14

问题


So I started using the Google Books API for an application that I am building and I am fairly happy with the results.

But I have noticed a strange behaviour sometimes. Some ISBNs do not return any book details even though the book exists in the database.
For example, if I give: https://www.googleapis.com/books/v1/volumes?q=isbn:0262527359,
I get the following response:

{
 "kind": "books#volumes",
 "totalItems": 0
}

I digged around the internet regarding this problem and found this link:
https://productforums.google.com/forum/#!topic/books-api/R5DvlRh-EKo

They suggest a workaround by not mentioning isbn: in the search query. So, the query becomes: https://www.googleapis.com/books/v1/volumes?q=0262527359
This method is not perfect but it's the only workaround I found.

That's when I noticed another problem. There is a mismatch between the description given on the webpage and the one in the response to the API call.

Can someone explain these strange behaviours to me? Are there any better solutions?

TIA.


回答1:


So i did some digging around and found out about this strange behaviour, when your query is of the form ...?q=isbn:0262527359, the results you get are the books that have this same isbn only and when you use the query of the form ...?q=0262527359, the results you get are the books that have any instance of this number in the record fields of any book. It can be either in editions isbn array or any other, this query will search all fields for matching results whereas the former query will only search isbn for matching results



来源:https://stackoverflow.com/questions/40410353/google-books-api-book-details-not-returned

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!