亚马逊 ECS API 可获取 1000 本畅销书 [英] Amazon ECS API to fetch 1000 top selling books

查看:22
本文介绍了亚马逊 ECS API 可获取 1000 本畅销书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要 API 来获取亚马逊上最畅销的书籍.默认情况下它只获取前 10 项,但我需要超过 10 个,近 1000 个项目内容,使用单次命中.

我需要使用 Amazon ECS API 抓取 1000 本畅销书的方法.

除了亚马逊 API 之外,还有什么方法可以抓取亚马逊上所有最畅销的书籍吗?

解决方案

这就是我的方法 - 但在本月底之后它不能用于超过 100 个项目,因为亚马逊将 ItemPage 限制为 10 个.

>

rescheck = Amazon::Ecs.item_search("此处搜索词", :response_group => '大', :country => 'uk')n=0rescheck.total_pages.times 做 |n|n=n+1如果 n <= rescheck.total_pagesres = Amazon::Ecs.item_search("此处搜索词", :response_group => 'Large', :item_page =>n, :country => 'uk')res.items.each 做 |item|asin = item.get('ASIN')title = item.get('ItemAttributes/Title')品牌 = item.get('ItemAttributes/Brand')#等等

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.

OR

I need the way to scrape the 1000 top selling books using the Amazon ECS API.

OR

Is there any way except the Amazon API to scrape all of the top selling books on Amazon?

解决方案

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆