# Amazon Product Scraper

This API can be used for scraping any product page from Amazon. All you need is the ASIN code of that product.

You have to send a GET request to **`https://api.scrapingdog.com/amazon/product`** with the below given parameters.

### Parameters

| Parameter                                                       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>api\_key<br><br><mark style="color:red;">required</mark></p> | <p>Your personal API key. Available on your dashboard<br><br>Type: <em><strong>String</strong></em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| <p>domain<br><br><mark style="color:red;">required</mark></p>   | <p>This is the TLD extension of the amazon page. <br><br>Example - in, com, tr, etc<br><br>Type: <strong><code>String</code></strong></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| <p>asin<br><br><mark style="color:red;">required</mark></p>     | <p>This is the Amazon product ID.<br><br>Type: <strong><code>String</code></strong></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| <p>country<br><br><mark style="color:red;">required</mark></p>  | <p>For targeting a particular country. This should be the <a href="#country">ISO Code</a> of a country. </p><p></p><p><strong><code>5</code></strong> credits will be charged for each successful request with this parameter. <strong><code>1</code></strong> credit will be charged if the target country is the USA.</p><p></p><p>Default value is <strong><code>us</code></strong>.<br><br>Type: <strong><code>String</code></strong></p>                                                                                                                                                                                                                   |
| postal\_code                                                    | <p>To get data from a particular postal code. <br><br>Type: <code>String</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| language                                                        | <p>The <code>language</code> parameter in your Amazon Product API should be defined using standard ISO 639-1 codes (e.g., <code>en</code> for English, <code>de</code> for German, <code>fr</code> for French) to specify the language in which the product data (like titles and descriptions) should be returned. This helps tailor results according to regional Amazon domains, such as <code>amazon.de</code> for German (<code>de</code>) or <code>amazon.fr</code> for French (<code>fr</code>). Use this parameter to map the request to the appropriate Amazon locale and return content in the desired language.<br><br>Type: <code>String</code></p> |

### TLD Supported

| Domain | Amazon Url    |
| ------ | ------------- |
| com    | amazon.com    |
| co.uk  | amazon.co.uk  |
| ca     | amazon.ca     |
| de     | amazon.de     |
| es     | amazon.es     |
| fr     | amazon.fr     |
| it     | amazon.it     |
| co.jp  | amazon.co.jp  |
| in     | amazon.in     |
| cn     | amazon.cn     |
| com.sg | amazon.com.sg |
| com.mx | amazon.com.mx |
| ae     | amazon.ae     |
| com.br | amazon.com.br |
| nl     | amazon.com.nl |
| com.au | amazon.com.au |
| com.tr | amazon.com.tr |
| sa     | amazon.sa     |
| se     | amazon.se     |
| pl     | amazon.pl     |

### Country

| Country Code | Country        |
| ------------ | -------------- |
| us           | United States  |
| gb           | United Kingdom |
| ca           | Canada         |
| de           | Germany        |
| es           | Spain          |
| fr           | France         |
| it           | Italy          |
| jp           | Japan          |
| in           | India          |
| cn           | China          |
| sg           | Singapore      |
| mx           | Mexico         |
| br           | Brazil         |
| nl           | Netherlands    |
| au           | Australia      |
| tr           | Turkey         |
| pl           | Poland         |

### API Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl "https://api.scrapingdog.com/amazon/product?api_key=5eaa61a6e562fc52fe763tr516e4653&domain=com&asin=B00AP877FS"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.scrapingdog.com/amazon/product"
params = {
    "api_key": "5eaa61a6e562fc52fe763tr516e4653",
    "domain": "com",
    "asin": "B00AP877FS"
}

response = requests.get(url, params=params)

if response.status_code == 200:
    data = response.json()
    print(data)
else:
    print(f"Request failed with status code {response.status_code}")

```

{% endtab %}

{% tab title="Nodejs" %}

```javascript
const axios = require('axios');

const url = 'https://api.scrapingdog.com/amazon/product';
const params = {
  api_key: '5eaa61a6e562fc52fe763tr516e4653',
  domain: 'com',
  asin: 'B00AP877FS',
};

axios
  .get(url, { params })
  .then((response) => {
    if (response.status === 200) {
      const data = response.data;
      console.log(data);
    } else {
      console.log(`Request failed with status code ${response.status}`);
    }
  })
  .catch((error) => {
    console.error('Request failed with an error:', error);
  });

```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$apiUrl = 'https://api.scrapingdog.com/amazon/product';
$apiKey = '5eaa61a6e562fc52fe763tr516e4653';
$domain = 'com';
$asin = 'B00AP877FS';

$queryString = http_build_query([
    'api_key' => $apiKey,
    'domain' => $domain,
    'asin' => $asin,
]);

$fullUrl = $apiUrl . '?' . $queryString;

$ch = curl_init($fullUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

if ($httpCode == 200) {
    $data = json_decode($response, true);
    print_r($data);
} else {
    echo "Request failed with status code $httpCode\n";
}

curl_close($ch);
?>

```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'net/http'
require 'json'

api_url = 'https://api.scrapingdog.com/amazon/product'
api_key = '5eaa61a6e562fc52fe763tr516e4653'
domain = 'com'
asin = 'B00AP877FS'

params = {
  'api_key' => api_key,
  'domain' => domain,
  'asin' => asin
}

uri = URI(api_url)
uri.query = URI.encode_www_form(params)

response = Net::HTTP.get_response(uri)

if response.is_a?(Net::HTTPSuccess)
  data = JSON.parse(response.body)
  puts data
else
  puts "Request failed with status code #{response.code}"
end

```

{% endtab %}

{% tab title="Java" %}

```java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class Main {
    public static void main(String[] args) {
        String apiURL = "https://api.scrapingdog.com/amazon/product";
        String apiKey = "5eaa61a6e562fc52fe763tr516e4653";
        String domain = "com";
        String asin = "B00AP877FS";

        try {
            // Create the URL with query parameters
            URL url = new URL(apiURL + "?api_key=" + apiKey + "&domain=" + domain + "&asin=" + asin);
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();

            // Set the request method to GET
            connection.setRequestMethod("GET");

            // Get the response code
            int responseCode = connection.getResponseCode();

            if (responseCode == 200) {
                // Read the response data
                BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                String line;
                StringBuilder response = new StringBuilder();

                while ((line = reader.readLine()) != null) {
                    response.append(line);
                }
                reader.close();

                // Print the response data
                System.out.println(response.toString());
            } else {
                System.out.println("Request failed with response code: " + responseCode);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

```

{% endtab %}
{% endtabs %}

### Response

```json
{
    "title": "Cosmetic Brush Kit 5 Pcs Makeup Brush Travel Set Princessa - Pink",
    "product_information": {
        "UPCundefined": "716189022169",
        "ASINundefined": "B00AP877FS",
        "CustomerReviews": "5.0 stars and 4 reviews"
    },
    "brand": "Brand: BeautyEZ",
    "brand_url": "/s/ref=bl_dp_s_web_0?ie=UTF8&search-alias=aps&field-keywords=BeautyEZ",
    "description": "This set of 5 pieces makeup brushes provides an assortment of brushes for cosmetic applications. It is an important beauty essential for you. The Brushes are used for applying powder, foundation, brush, and eye shadow. Its design is suitable to carry and use when you are travelling.",
    "price": "$6.95",
    "list_price": "$6.95",
    "shipping_info": "Details",
    "availability_status": "In Stock",
    "images": [
        "https://m.media-amazon.com/images/I/41BWGQGj93L.jpg",
        "https://m.media-amazon.com/images/I/41tEyvqzdxL.jpg",
        "https://m.media-amazon.com/images/I/41Bvv57t03L.jpg",
        "https://m.media-amazon.com/images/I/41Bvv57t03L.jpg"
    ],
    "number_of_videos": 0,
    "product_category": "Beauty & Personal Care › Tools & Accessories › Makeup Brushes & Tools › Brush Sets",
    "average_rating": 5,
    "feature_bullets": [
        "1 set of 5 pcs makeup brushes",
        "Lash & Brow Comb, Sponge Tip Applicator",
        "Powder Brush, Liner Brush and Eye Shadow Brush",
        "Soft tips and Stylish design",
        "4 to 4.2 inches each to easily fit in your travel case."
    ],
    "total_reviews": 4,
    "total_answered_questions": "",
    "other_sellers": [],
    "customization_options": {
        "color": [],
        "size": [],
        "style": []
    },
    "merchant_info": "BEAUTYezSHOP",
    "ships_from": "BEAUTYezSHOPBEAUTYezSHOP",
    "sold_by": "BEAUTYezSHOP"
}
```

### Video Tutorial

{% embed url="<https://www.loom.com/share/105dc3c762124ec191475a6733aa69cb>" %}
