0.1.0 ā€¢ Published 4 years ago

use-amazon v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

use-amazon

šŸ“š use-amazon is a hook that lets you get product info from url or book cover in React.

Table of Contents

Install via npm

npm i use-amazon

Quick started

git clone github.com/tseijp/use-amazon
cd use-amazon
npm i
npm start

Simple example

import React from 'react'
import { useAmazon } from 'use-amazon'

export function App() {
    const book = useAmazon('https://amazon.com/xxx/dp/xxx')
    return <img {...book.img} />
}

Available hooks

HookDescription
useAmazonget amazon data from url

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

valuemeanw*h sizebook sizenotes
THUMBZZZsamnale75Ɨ7552Ɨ75
TZZZZZZZsmall110Ɨ11077Ɨ110
MZZZZZZZmiddle160Ɨ160112Ɨ160
LZZZZZZZlarge500Ɨ500349Ɨ500if h<500, return Full size image