# Amazon Product API (Async)

The `Amazon Product API` endpoint will retrieve product data from an Amazon product page and transform it into usable JSON. It also includes variant details for the product, such as size, color, and other available options (if applicable).

{% hint style="success" %}
The Amazon Product API endpoint also returns **all publicly available** reviews for an Amazon product page (ASIN).
{% endhint %}

**Single ASIN Request**

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

```bash
curl -X POST \
	-H "Content-Type: application/json" \
	-d '{
			"apiKey": "API_KEY",
			"asin": "ASIN",
			"country_code": "COUNTRY_CODE",
			"tld": "TLD",
			"callback": {
				"type": "webhook",
				"url": "YYYYY"
			}
		}' \
"https://async.scraperapi.com/structured/amazon/product"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://async.scraperapi.com/structured/amazon/product"
headers = {
    "Content-Type": "application/json"
}
data = {
    "apiKey": "API_KEY",
    "asin": "ASIN",
    "country_code": "COUNTRY_CODE",
    "tld" : "TLD",
    "callback": {
        "type": "webhook",
        "url": "YYYYY"
    }
}

response = requests.post(url, json=data, headers=headers)
print(response.text)
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
import fetch from 'node-fetch';
const options = {
  method: 'POST',
  body: JSON.stringify({
    apiKey: 'API_KEY',
    asin: 'ASIN',
    country_code: 'COUNTRY_CODE',
    tld: 'TLD',
    callback: {
            type: 'webhook',
            url: 'YYYYY' }}),
  headers: {
    'Content-Type': 'application/json',
  },
}

fetch('https://async.scraperapi.com/structured/amazon/product', options)
  .then(response => {
    response.text().then(text => console.log(text));
  })
  .catch(error => {
    console.log(error)
  })
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$curl = curl_init();
$data = json_encode(array(
    'apiKey' => 'API_KEY',
    'asin' => 'ASIN',
    'country_code' => 'COUNTRY_CODE',
    'tld' => 'TLD',
    'callback' => array(
        'type' => 'webhook',
        'url' => 'YYYYY'
    )
));
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://async.scraperapi.com/structured/amazon/product',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => $data,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));
$response = curl_exec($curl);
if (curl_errno($curl)) {
    echo 'Error:' . curl_error($curl);
} else {
    echo $response;
}
curl_close($curl);
?>
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://async.scraperapi.com/structured/amazon/product')
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = {
  apiKey: 'API_KEY',
  asin: 'ASIN',
  country_code: 'COUNTRY_CODE',
  tld: 'TLD',
  callback: {
    type: 'webhook',
    url: 'YYYYY'
  }
}.to_json
begin
  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
  end
  puts response.body
rescue => e
  puts "Error: #{e.message}"
end
```

{% endtab %}

{% tab title="Java" %}

```java
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import javax.net.ssl.HttpsURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
public class Main {
    public static void main(String[] args) {
        try {
            String apiKey = "API_KEY";
            String jsonInputString = "{"
                + "\"apiKey\": \"" + apiKey + "\", "
                + "\"asin\": \"ASIN\", "
                + "\"country_code\": \"COUNTRY_CODE\", "
                + "\"tld\": \"TLD\", "
                + "\"callback\": {"
                + "    \"type\": \"webhook\", "
                + "    \"url\": \"YYYYY\""
                + "}}";

            URL url = new URL("https://async.scraperapi.com/structured/amazon/product");
            HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
            connection.setRequestMethod("POST");
            connection.setRequestProperty("Content-Type", "application/json");
            connection.setRequestProperty("Accept", "*/*");
            connection.setDoOutput(true);
            try (OutputStream os = connection.getOutputStream()) {
                byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8);
                os.write(input, 0, input.length);
            }
            int responseCode = connection.getResponseCode();
            StringBuilder response = new StringBuilder();
            BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
            String readLine;
            while ((readLine = in.readLine()) != null) {
                response.append(readLine);
            }
            in.close();
            if (responseCode == HttpURLConnection.HTTP_OK) {
                System.out.println("Response: " + response.toString());
            } else {
                throw new Exception("Error in API Call: Response code " + responseCode + "\nbody: " + response.toString());
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
```

{% endtab %}
{% endtabs %}

**Multiple ASINs Request**

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

```bash
curl -X POST \
	-H "Content-Type: application/json" \
	-d '{
			"apiKey": "API_KEY",
			"asins": ["ASIN1", "ASIN2],
			"country_code": "COUNTRY_CODE",
			"tld": "TLD",
			"callback": {
				"type": "webhook",
				"url": "YYYYY"
			}
		}' \
"https://async.scraperapi.com/structured/amazon/product"
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://async.scraperapi.com/structured/amazon/product"
headers = {
    "Content-Type": "application/json"
}
data = {
    "apiKey": "API_KEY",
    "asins": ["ASIN1", "ASIN2"],
    "country_code": "COUNTRY_CODE",
    "tld" : "TLD",
    "callback": {
        "type": "webhook",
        "url": "YYYYY"
    }
}

response = requests.post(url, json=data, headers=headers)
print(response.text)
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
import fetch from 'node-fetch';
const options = {
  method: 'POST',
  body: JSON.stringify({
    apiKey: 'API_KEY',
    asins: ['ASIN1','ASIN2'],
    country_code: 'COUNTRY_CODE',
    tld: 'TLD',
    callback: {
            type: 'webhook',
            url: 'YYYYY' }}),
  headers: {
    'Content-Type': 'application/json',
  },
}

fetch('https://async.scraperapi.com/structured/amazon/product', options)
  .then(response => {
    response.text().then(text => console.log(text));
  })
  .catch(error => {
    console.log(error)
  })
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$curl = curl_init();
$data = json_encode(array(
    'apiKey' => 'API_KEY',
    'asins' => ['ASIN1','ASIN2'],
    'country_code' => 'COUNTRY_CODE',
    'tld' => 'TLD',
    'callback' => array(
        'type' => 'webhook',
        'url' => 'YYYYY'
    )
));
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://async.scraperapi.com/structured/amazon/product',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => $data,
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
));
$response = curl_exec($curl);
if (curl_errno($curl)) {
    echo 'Error:' . curl_error($curl);
} else {
    echo $response;
}
curl_close($curl);
?>
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://async.scraperapi.com/structured/amazon/product')
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = {
  apiKey: 'API_KEY',
  asin: ['ASIN1','ASIN2'],
  country_code: 'COUNTRY_CODE',
  tld: 'TLD',
  callback: {
    type: 'webhook',
    url: 'YYYYY'
  }
}.to_json
begin
  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
    http.request(request)
  end
  puts response.body
rescue => e
  puts "Error: #{e.message}"
end
```

{% endtab %}

{% tab title="Java" %}

```java
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import javax.net.ssl.HttpsURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
public class Main {
    public static void main(String[] args) {
        try {
            String apiKey = "API_KEY";
            String jsonInputString = "{"
                + "\"apiKey\": \"" + apiKey + "\", "
                + "\"asins\": [\"ASIN1\", \"ASIN2\"], "
                + "\"country_code\": \"COUNTRY_CODE\", "
                + "\"tld\": \"TLD\", "
                + "\"callback\": {"
                + "    \"type\": \"webhook\", "
                + "    \"url\": \"YYYYY\""
                + "}}";

            URL url = new URL("https://async.scraperapi.com/structured/amazon/product");
            HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
            connection.setRequestMethod("POST");
            connection.setRequestProperty("Content-Type", "application/json");
            connection.setRequestProperty("Accept", "*/*");
            connection.setDoOutput(true);
            try (OutputStream os = connection.getOutputStream()) {
                byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8);
                os.write(input, 0, input.length);
            }
            int responseCode = connection.getResponseCode();
            StringBuilder response = new StringBuilder();
            BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
            String readLine;
            while ((readLine = in.readLine()) != null) {
                response.append(readLine);
            }
            in.close();
            if (responseCode == HttpURLConnection.HTTP_OK) {
                System.out.println("Response: " + response.toString());
            } else {
                throw new Exception("Error in API Call: Response code " + responseCode + "\nbody: " + response.toString());
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
```

{% endtab %}
{% endtabs %}

**Supported Parameters**

<table><thead><tr><th width="246">Parameters</th><th>Details</th></tr></thead><tbody><tr><td><code>API_KEY</code> (required)</td><td>Your API Key.</td></tr><tr><td><code>ASIN</code> (required)</td><td><code>ASIN</code> - <strong>Amazon Standard Identification Number</strong>. Please note, that ASIN's are market specific (TLD specific). You can usually find the ASINs in the URL of an Amazon product (example: B07FTKQ97Q)</td></tr><tr><td><code>TLD</code></td><td><p>Amazon market to be scraped.</p><p>Valid values include:</p><p><strong>com</strong> (amazon.com)</p><p><strong>co.uk</strong> (amazon.co.uk)</p><p><strong>ca</strong> (amazon.ca)</p><p><strong>de</strong> (amazon.de)</p><p><strong>es</strong> (amazon.es)</p><p><strong>fr</strong> (amazon.fr)</p><p><strong>ie</strong> (amazon.ie)</p><p><strong>it</strong> (amazon.it)</p><p><strong>co.jp</strong> (amazon.co.jp)</p><p><strong>co.za</strong> (amazon.co.za)</p><p><strong>in</strong> (amazon.in)</p><p><strong>cn</strong> (amazon.cn)</p><p><strong>com.sg</strong> (amazon.com.sg)</p><p><strong>com.mx</strong> (amazon.com.mx)</p><p><strong>ae</strong> (amazon.ae)</p><p><strong>com.br</strong> (amazon.com.br)</p><p><strong>nl</strong> (amazon.nl)</p><p><strong>com.au</strong> (amazon.com.au)</p><p><strong>com.tr</strong> (amazon.com.tr)</p><p><strong>sa</strong> (amazon.sa)</p><p><strong>se</strong> (amazon.se)</p><p><strong>pl</strong> (amazon.pl)</p></td></tr><tr><td><code>COUNTRY_CODE</code></td><td><p>Valid values are two letter country codes for which we offer Geo Targeting (e.g. “<strong>au</strong>”, “<strong>es</strong>”, “<strong>it</strong>”, etc.).</p><p>Where an amazon domain needs to be scraped from another country (e.g. scraping amazon.com from Canada to get Canadian shipping information), <strong>both TLD and COUNTRY parameters must be specified.</strong></p></td></tr><tr><td><code>OUTPUT_FORMAT</code></td><td><p>For SDEs, we offer CSV and JSON output. JSON is default if parameter is not added. Options:</p><ul><li>csv</li><li>json (default)</li></ul></td></tr><tr><td>ZIP Code Targeting</td><td>To find out mote about ZIP Code targeting, please follow <a href="/pages/Holp9APEMCn7lDkzH8zp">this</a> link</td></tr></tbody></table>

### Sample Response

Single ASIN Request

```json
{
	"id": "f9c41146-ecd3-415c-ae0a-461de670e2e8",
	"status": "running",
	"statusUrl": "http://async.scraperapi.com/jobs/f9c41146-ecd3-415c-ae0a-461de670e2e8",
	"asin": "B079BLHH67"
	"tld": ".com"
}
```

Multiple ASINs Request

```json
[
	{
		"id": "5b0c838a-d0eb-46c3-ad9a-e82e398d56a5",
		"status": "running",
		"statusUrl": "http://async.scraperapi.com/structured/amazon/product/5b0c838a-d0eb-46c3-ad9a-e82e398d56a5",
		"asin": "B079BLHH67"
		"tld": ".com"
	},
	{
		"id": "df83b9e1-be25-40de-8702-4e934f057867",
		"status": "running",
		"statusUrl": "http://async.scraperapi.com/structured/amazon/product/df83b9e1-be25-40de-8702-4e934f057867",
		"asin": "B07G98GG51"
		"tld": ".com"
	}
]
```

After the job(s) finish, you will find the result under the <mark style="color:red;">response</mark> key in the response JSON object. The structure is the same as in the corresponding SYNC data endpoint.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.scraperapi.com/structured-data-endpoints/e-commerce/amazon/amazon-product-api-async.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
