Get list of ALL offers from Amazon Product Advertising API

后端 未结 2 1562
长发绾君心
长发绾君心 2020-12-14 07:51

I need to be able to get a listing of all offers for a product using the amazon API. This is the request I\'m sending:

http://webservices.amazon.com/onca/xml         


        
2条回答
  •  南方客
    南方客 (楼主)
    2020-12-14 08:16

    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.

提交回复
热议问题