亚马逊ECS API获取1000最畅销的书籍 [英] Amazon ECS API to fetch 1000 top selling books
问题描述
我需要的API来获取对亚马逊最畅销的书籍。默认情况下<一href="http://docs.amazonwebservices.com/AWSECommerceService/2011-08-01/DG/index.html?RG_TopSellers.html">it只取前10项,但我需要超过10个,近1000项内容通过单发命中。
I need the API to fetch the top selling books on Amazon. By default it only fetches the top 10 items, but I need more than 10, near about 1000 items content by using single hit.
或
我要凑使用亚马逊的ECS API的1000最畅销书的方式。
I need the way to scrape the 1000 top selling books using the Amazon ECS API.
或
有没有什么办法,除了亚马逊的API刮所有的最畅销书在亚马逊?
Is there any way except the Amazon API to scrape all of the top selling books on Amazon?
推荐答案
下面是我如何做到这一点 - 但它不会超过100个项目在本月亚马逊结束后的工作都限制ItemPage为10。
here's how I do it - but it won't work for more than 100 items after the end of this month as Amazon are limiting ItemPage to 10.
rescheck = Amazon::Ecs.item_search("search term here", :response_group => 'Large', :country => 'uk')
n=0
rescheck.total_pages.times do |n|
n=n+1
if n <= rescheck.total_pages
res = Amazon::Ecs.item_search("search term here", :response_group => 'Large', :item_page =>n, :country => 'uk')
res.items.each do |item|
asin = item.get('ASIN')
title = item.get('ItemAttributes/Title')
brand = item.get('ItemAttributes/Brand')
#etc
这篇关于亚马逊ECS API获取1000最畅销的书籍的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!