Amazon Product Advertising API Signature - PHP

Discussion in 'Amazon' started by myhart, Jun 3, 2009.

  1. freshdevelopment

    freshdevelopment Notable Member

    Messages:
    1,303
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    240
    #81
    Full working code is a bit vague.. what do you actually want to do?
     
    freshdevelopment, Apr 13, 2013 IP
  2. dev_ch7

    dev_ch7 Greenhorn

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #82
    I want to fetch book information like author, image ISBN 10, ISBN 13 by providing ISBN. Also, i would like to fetch the buyback price of the book.
     
    dev_ch7, Apr 13, 2013 IP
  3. jangxin

    jangxin Active Member

    Messages:
    136
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #83
    thanks for share
     
    jangxin, Apr 22, 2013 IP
  4. jemekite

    jemekite Well-Known Member

    Messages:
    273
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    138
    #84
    Have you try this library? Amazon ECS PHP Library
     
    jemekite, Apr 22, 2013 IP
  5. uleesgold

    uleesgold Member

    Messages:
    288
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    30
    #85
    It looks like one of the only reasonable things that I've seen so far, for the Amazon API. Is there a free and easy way to get numerous ASINs, or see what an ASINs ISBN/UPC is?

    The code I found on this website ( BraveChoices ) did not produce any results (just a blank page.) I honestly don't much about PHP or else I'd debug it myself.

    <?php
    
    // Which Amazon URL to scrape?
    $base_url = "http://www.amazon.com/s/ref=sr_nr_p_n_feature_keywords_3?rh=n%3A228013%2Cn%3A!468240%2Cn%3A328182011%2Cn%3A551236%2Cn%3A552660%2Cp_n_feature_keywords_two_browse-bin%3A7065982011|7065983011|7065984011&amp;bbn=552660&amp;ie=UTF8&amp;qid=1409504427&amp;rnid=5909567011";
    
    // How many pages to scrape?
    $total_pages = 3;
    
    // Require the Simple HTML DOM library
    require_once("simple_html_dom.php");
    
    // Initiate the page count
    $page = 1;
    
    // Open the ASINs file for writing
    $handle = fopen("asins.txt", "w");
    
    // Start looping through the pages, starting from 1 and stopping to $total_pages
    while ($page <= $total_pages) {
    
    // Make paged URL of the Amazon.com category page
    $url = "$base_url&amp;page=$page";
    
    // Fetch it with cURL
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_COOKIESESSION, true );
    curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt" );
    curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt" );
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0");
    $curl_scraped_page = curl_exec($ch);
    
    // Parse the fetched page with Simple HTML DOM
    $html = new simple_html_dom();
    $html->load($curl_scraped_page);
    
    // Start looping through products
    foreach($html->find("div.prod") as $item) {
    
    // Get ASIN from the scraped HTML
    $asin = $item->name;
    
    // Write the ASIN to the ASIN file
    fwrite($handle, "$asin\n");
    
    // End of product
    }
    
    // Increment page variable by one
    $page++;
    
    // End of page
    }
    
    // Clear the HTML object
    $html->clear();
    
    // Close the ASINs file
    fclose($handle);
    
    ?>
    PHP:
    It looks like maybe Amazon doesn't use a div class of "prod" to display these things anymore.
     
    uleesgold, Dec 10, 2014 IP