Skip to main content

Available book apis

React​

use-book exports several hooks and components that can handle different book:

HookDescription
useBookHandles the book info

Usage​

const state = useBook(props)
return <img src={state.src}>
  • props is an object containing options for the book
  • state is an object containing all attributes of the book.

Components is a shorthand for passing hooks directly to children.

return (
<UseBook {...props}>
{state => <img src={state.src} />}
</UseNote>
)
// or
return (
<UseNote as="div" {...props}/>
)

Performance pitfalls​

URL

valuehttps://{HOST}/images/P/{ASIN/ISBN}.{COUNTRY}.{SIZE}
HOSTimages-na.ssl-images-amazon.com or images-jp.amazon.com
ISBNInternational Standard Book Number
ASINAmazon Standard Identification Number
COUNTRYJapan:09

SIZE

valuekeymeanw*h sizebook sizenotes
THUMBZZZxssamnale75×7552×75
TZZZZZZZsmsmall110×11077×110
MZZZZZZZmdmiddle160×160112×160
LZZZZZZZlglarge500×500349×500if h<500, return Full size image