问题
I'm working in a very limited environment and I cannot use any API that requires authentication. The API at https://openlibrary.org would be perfect, but it does not serve a book summary. All I need to do is get a book summary (akin to the back cover of a book) from an ISBN number that I pass.
I have to use javascript because I only have access to the client-side code.
回答1:
Based on Amazon's Product Advertising API documentation:
- ItemLookup
- EditorialReview Response Group
You should be able to, without authentication, pull up the Product Description for a book using a request to:
http://webservices.amazon.com/onca/xml?
Service=AWSECommerceService&
AWSAccessKeyId=[AWS Access Key ID]&
Operation=ItemLookup&
ItemId=[ISBN]&
IdType=ISBN&
ResponseGroup=EditorialReview&
Condition=All&
Timestamp=[YYYY-MM-DDThh:mm:ssZ]&
Signature=[Request Signature]
Yes, you may have to sign up for an Amazon access key, and there may be rate-limiting which applies to your request, but this should get you there without maintaining a user authentication session.
回答2:
A Google Web Search API might be helpful too (https://www.google.com/search?q=0596002068&)
Then consequently scrape the first result using something like https://www.mashape.com/warting/scrapegoat#!endpoint-scrapePrerendered
I was able to get the summary of the book like below:
来源:https://stackoverflow.com/questions/19979137/is-there-a-javascript-api-to-get-a-book-summary-based-on-isbn