Get list of ALL offers from Amazon Product Advertising API

核能气质少年 提交于 2019-11-28 20:23:08

After doing some research this not possible in the API, however you can parse the HTML of the standard page to get the details:

1) Use http://simplehtmldom.sourceforge.net/ for parsing HTML (If your not using php, you'll need find something similar)

2) CURL (make sure you set your header or amazon will error) both http://www.amazon.com/gp/offer-listing/B007IJQDQQ/?condition=new and http://www.amazon.com/gp/offer-listing/B007IJQDQQ/?condition=used

3) To handle pages count total number of offers (found #new span.numberreturned) and divide by 15 to work out number of pages.

4) You'll need to parse each page, URLs would be like some:

eg page 2 http://www.amazon.com/gp/offer-listing/B005IMB5SG/?condition=used&startIndex=15

eg page 3 http://www.amazon.com/gp/offer-listing/B005IMB5SG/?condition=used&startIndex=30

Hope this is enough info to get you started, sorry I don't have access to the working script I wrote a while ago.

The Product API scratch pad returns an "All Offers" link which you can manually fetch over HTTP and parse to provide a list of DOM nodes which contain the information you need.

It's like the http://www.amazon.com/gp/offer-listing/B007IJQDQQ/?condition=used link @dciso mentioned several years ago but with the API information contained to help follow the amazon rules closer.

<ItemLookupResponse>
    <Items>
        <Item>
        <ASIN>B00I8BICB2</ASIN>
        <ParentASIN>B077PSDB4X</ParentASIN>
        <DetailPageURL>https://www.amazon.com/Sony-Mirrorless-Digitial-3-0-Inch-16-50mm/dp/B00I8BICB2?psc=1&SubscriptionId_____tag=_____&linkCode=xm2&camp=2025&creative=165953&creativeASIN=B00I8BICB2</DetailPageURL>
        <ItemLinks>
            ...
            <ItemLink>
                <Description>All Offers</Description>
                <URL>https://www.amazon.com/gp/offer-listing/B00I8BICB2?SubscriptionId=______&tag=_____&linkCode=xm2&camp=2025&creative=386001&creativeASIN=B00I8BICB2</URL>
            </ItemLink>
        </ItemLinks>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!