NAVNavbar
Logo
cURL php NodeJS Python cSharp

Get Amazon ASIN Results by id

 
This endpoint will provide you with information about the product and ASINs of all its modifications listed on Amazon.

Instead of ‘login’ and ‘password’ use your credentials from https://app.dataforseo.com/api-access

<?php
// You can download this file from here https://cdn.dataforseo.com/v3/examples/php/php_RestClient.zip
require('RestClient.php');
$api_url = 'https://api.dataforseo.com/';
// Instead of 'login' and 'password' use your credentials from https://app.dataforseo.com/api-access
$client = new RestClient($api_url, null, 'login', 'password');

try {
   $result = array();
   // #1 - using this method you can get a list of completed tasks
   // GET /v3/merchant/amazon/asin/tasks_ready
   $tasks_ready = $client->get('/v3/merchant/amazon/asin/tasks_ready');
   // you can find the full list of the response codes here https://docs.dataforseo.com/v3/appendix/errors
   if (isset($tasks_ready['status_code']) AND $tasks_ready['status_code'] === 20000) {
      foreach ($tasks_ready['tasks'] as $task) {
         if (isset($task['result'])) {
            foreach ($task['result'] as $task_ready) {
               // #2 - using this method you can get results of each completed task
               // GET /v3/merchant/amazon/asin/task_get/advanced/$id
               if (isset($task_ready['endpoint_advanced'])) {
                  $result[] = $client->get($task_ready['endpoint_advanced']);
               }
               // #3 - another way to get the task results by id
               // GET /v3/merchant/amazon/asin/task_get/advanced/$id
               /*
               if (isset($task_ready['id'])) {
                  $result[] = $client->get('/v3/merchant/amazon/asin/task_get/advanced/' . $task_ready['id']);
               }
               */
            }
         }
      }
   }
   print_r($result);
   // do something with result
} catch (RestClientException $e) {
   echo "n";
   print "HTTP code: {$e->getHttpCode()}n";
   print "Error code: {$e->getCode()}n";
   print "Message: {$e->getMessage()}n";
   print  $e->getTraceAsString();
   echo "n";
}
$client = null;
?>

The above command returns JSON structured like this:

{
  "version": "0.1.20210519",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.0500 sec.",
  "cost": 0,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "05251541-1535-0192-0000-b4d6f31c9ceb",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.0227 sec.",
      "cost": 0,
      "result_count": 1,
      "path": [
        "v3",
        "merchant",
        "amazon",
        "asin",
        "task_get",
        "advanced",
        "05251541-1535-0192-0000-b4d6f31c9ceb"
      ],
      "data": {
        "se_type": "shopping",
        "api": "merchant",
        "function": "asin",
        "se": "amazon",
        "language_code": "en_GB",
        "location_name": "United Kingdom",
        "asin": "B08KV5ZJBZ",
        "priority": 2,
        "device": "desktop",
        "os": "windows"
      },
      "result": [
        {
          "asin": "B08KV5ZJBZ",
          "type": "shopping",
          "se_domain": "amazon.co.uk",
          "location_code": 2826,
          "language_code": "en_GB",
          "check_url": "https://www.amazon.co.uk/dp/B08KV5ZJBZ?language=en_GB",
          "datetime": "2021-05-25 12:41:51 +00:00",
          "item_types": [
            "amazon_product_info"
          ],
          "items_count": 1,
          "items": [
            {
              "type": "amazon_product_info",
              "rank_group": 1,
              "rank_absolute": 1,
              "position": "left",
              "xpath": "/#document",
              "title": "Code Name Bananas: The hilarious and epic new children’s book from multi-million bestselling author David Walliams",
              "details": "Product details\nASIN\n: B08KV5ZJBZ\nPublisher\n: HarperCollinsChildren’sBooks (5 Nov. 2020)\nLanguage\n: English\nFile size\n: 125658 KB\nText-to-Speech\n: Enabled\nScreen Reader\n: Supported\nEnhanced typesetting\n: Enabled\nX-Ray\n: Not Enabled\nWord Wise\n: Enabled\nPrint length\n: 481 pages\nPage numbers source ISBN\n: 0008305838\nBest Sellers Rank: 7,005 in Kindle Store ( See Top 100 in Kindle Store )\n1 in Children's Zoo eBooks\n1 in Children's Military Historical Fiction\n2 in Children's Spy eBooks\nCustomer reviews:\nASIN\n: B08KV5ZJBZ\nPublisher\n: HarperCollinsChildren’sBooks (5 Nov. 2020)\nLanguage\n: English\nFile size\n: 125658 KB\nText-to-Speech\n: Enabled\nScreen Reader\n: Supported\nEnhanced typesetting\n: Enabled\nX-Ray\n: Not Enabled\nWord Wise\n: Enabled\nPrint length\n: 481 pages\nPage numbers source ISBN\n: 0008305838",
              "image_url": "https://m.media-amazon.com/images/I/51wPfsrMekL._SY346_.jpg",
              "author": "by David Walliams (Author) › Visit Amazon's David Walliams Page search results for this author David Walliams (Author), Tony Ross (Illustrator) Format: Kindle Edition",
              "data_asin": "B08KV5ZJBZ",
              "parent_asin": null,
              "product_asins": [
                "0008454299",
                "0008454310",
                "B08LH7B5FJ",
                "0008305838",
                "B08KV5ZJBZ"
              ],
              "price_from": 6.5,
              "price_to": 10.15,
              "currency": "GBP",
              "is_amazon_choice": false,
              "rating": {
                "type": "rating_element",
                "position": "left",
                "rating_type": "Max5",
                "value": "4.8",
                "votes_count": 15188,
                "rating_max": "5"
              },
              "is_newer_model_available": false,
              "newer_model": null,
              "categories": null,
              "product_information": [
                {
                  "type": "product_information_extended_item",
                  "section_name": "Product description",
                  "contents": [
                    {
                      "type": "product_information_rows",
                      "title": "Review",
                      "rows": [
                        {
                          "type": "product_information_text_row",
                          "text": "PRAISE FOR DAVID WALLIAMS: “Dahl finally has a worthy successor” – Telegraph “Another triumph for David Walliams. His books are a breath of wonderful fresh air” – The Sun ‘[Walliams’ books] are brilliantly, beautifully and seemingly effortlessly written … Mr Dahl finally has a worthy successor’ Telegraph ‘Walliams understands something crucial about children and stories’ Metro “A great comic tale… Walliams is a natural wit” – Evening Standard \"Well written, funny, touching\" – Observer \"A passionate celebration of individuality\" – Telegraph \"Believable characters and a story that's original and intriguing” ***** – Heat “Charming, funny” – The Times “Has a lovely, Dahlian fluency to it” – Time Out"
                        }
                      ]
                    },
                    {
                      "type": "product_information_rows",
                      "title": "Book Description",
                      "rows": [
                        {
                          "type": "product_information_text_row",
                          "text": "The hilarious and epic new children’s book from multi-million bestselling author David Walliams in 2020"
                        }
                      ]
                    }
                  ]
                },
                {
                  "type": "product_information_extended_item",
                  "section_name": "From the Publisher",
                  "contents": [
                    {
                      "type": "product_information_rows",
                      "title": "Every secret military operation needs a code name...",
                      "rows": [
                        {
                          "type": "product_information_image_row",
                          "alt": "code name bananas",
                          "url": "https://m.media-amazon.com/images/S/aplus-media/vc/2a5eba56-8708-49a0-ab06-4ec9bf48925a.__CR0,0,1500,1500_PT0_SX300_V1___.jpg"
                        },
                        {
                          "type": "product_information_text_row",
                          "text": "\"Every secret military operation needs a code name...\" A must-have gift for David Walliams’s readers, Code Name Bananas is a rip-roaring, action packed, page-turning adventure to capture the imaginations of children across the globe! David Walliams said, \" This book is an epic comedy adventure set in World War II with an animal at the centre of the story. I hope children will fall in love with Gertrude the gorilla. There is plenty of humour, action and excitement to delight even the most reluctant reader.\" Eric and Gertrude embark on a daring adventure across 1940s London, and together they explore...\nLondon Zoo!\nHyde Park!\nVictoria Station!\nLondon Bridge!\nAnd all the way to Bognor Regis!\nRead more"
                        }
                      ]
                    },
                    {
                      "type": "product_information_rows",
                      "title": "Meet the hilarious characters from Code Name Bananas!",
                      "rows": [
                        {
                          "type": "product_information_image_row",
                          "alt": "eric",
                          "url": "https://m.media-amazon.com/images/S/aplus-media/vc/5510d0e4-e203-42cc-a045-3477b797a8e0.__CR0,0,300,300_PT0_SX300_V1___.jpg"
                        },
                        {
                          "type": "product_information_image_row",
                          "alt": "gertrude",
                          "url": "https://m.media-amazon.com/images/S/aplus-media/vc/cbc1e17d-3d2b-452c-b422-8b9c58518736.__CR0,0,300,300_PT0_SX300_V1___.jpg"
                        },
                        {
                          "type": "product_information_image_row",
                          "alt": "sid",
                          "url": "https://m.media-amazon.com/images/S/aplus-media/vc/4e8359c0-e7a2-48b7-a8d8-6577ab6eab89.__CR0,0,300,300_PT0_SX300_V1___.jpg"
                        },
                        {
                          "type": "product_information_text_row",
                          "text": "Meet the hilarious characters from Code Name Bananas!\nERIC \tGERTRUDE \tSID\nRead more"
                        }
                      ]
                    },
                    {
                      "type": "product_information_rows",
                      "title": null,
                      "rows": [
                        {
                          "type": "product_information_image_row",
                          "alt": "code name bananas",
                          "url": "https://m.media-amazon.com/images/S/aplus-media/vc/9affc1f6-263e-48ad-b913-1bdf262df68e.__CR0,0,150,300_PT0_SX150_V1___.jpg"
                        },
                        {
                          "type": "product_information_image_row",
                          "alt": "the world's worst parents",
                          "url": "https://m.media-amazon.com/images/S/aplus-media/vc/39f22a0a-2d59-492b-bd29-078a84a805d8.__CR0,0,150,300_PT0_SX150_V1___.jpg"
                        },
                        {
                          "type": "product_information_image_row",
                          "alt": "slime",
                          "url": "https://m.media-amazon.com/images/S/aplus-media/vc/e8b7b79b-f8d4-4306-928b-ff753246703e.__CR0,0,150,300_PT0_SX150_V1___.jpg"
                        },
                        {
                          "type": "product_information_image_row",
                          "alt": "the beast of buckingham palace",
                          "url": "https://m.media-amazon.com/images/S/aplus-media/vc/d059dfa5-86a7-4133-b039-d10f201bcfb2.__CR0,0,150,300_PT0_SX150_V1___.jpg"
                        },
                        {
                          "type": "product_information_text_row",
                          "text": "Code Name Bananas The World's Worst Parents Slime The Beast of Buckingham Palace\nGo on an adventure! ✓ \t✓ \t✓ \t✓\nMeet brave heroes! ✓ \t✓ \t✓ \t✓\nLaugh out loud! ✓ \t✓ \t✓ \t✓\nGasp with delight! ✓ \t✓ \t✓ \t✓\nExperience the magic! ✓ \t✓ \t✓ \t✓"
                        }
                      ]
                    },
                    {
                      "type": "product_information_rows",
                      "title": null,
                      "rows": [
                        {
                          "type": "product_information_image_row",
                          "alt": "code name bananas",
                          "url": "https://m.media-amazon.com/images/S/aplus-media/vc/0d5a78ef-d9aa-4862-b384-7ae1ea082201.__CR0,0,970,300_PT0_SX970_V1___.jpg"
                        },
                        {
                          "type": "product_information_video_row",
                          "preview": "https://m.media-amazon.com/images/S/aplus-media/vc/a42df2dd-1731-4582-8994-843ec8556c36.__CR0,0,1464,600_PT0_SX1464_V1___.jpg",
                          "url": "https://m.media-amazon.com/images/S/aplus-media/vc/c3782483-667c-4fdf-8c67-c35e99a16dfb.mp4"
                        },
                        {
                          "type": "product_information_text_row",
                          "text": "Read more"
                        }
                      ]
                    }
                  ]
                },
                {
                  "type": "product_information_details_item",
                  "section_name": "Product details",
                  "body": {
                    "ASIN": "B08KV5ZJBZ",
                    "Publisher": "HarperCollinsChildren’sBooks (5 Nov. 2020)",
                    "Language": "English",
                    "File size": "125658 KB",
                    "Text-to-Speech": "Enabled",
                    "Screen Reader": "Supported",
                    "Enhanced typesetting": "Enabled",
                    "X-Ray": "Not Enabled",
                    "Word Wise": "Enabled",
                    "Print length": "481 pages",
                    "Page numbers source ISBN": "0008305838",
                    "Best Sellers Rank": "7,005 in Kindle Store ( See Top 100 in Kindle Store )\n1 in Children's Zoo eBooks\n1 in Children's Military Historical Fiction\n2 in Children's Spy eBooks",
                    "Customer reviews": "4.8 out of 5 stars 15,188 ratings"
                  }
                }
              ],
              "product_images_list": null,
              "description": null,
              "is_available": true
              "product_videos_list": null,
              "description": null,
              "is_available": true
            }
          ]
        }
      ]
    }
  ]
}

Description of the fields for sending a request:

Field name Type Description
id string task identifier
unique task identifier in our system in the UUID format
you will be able to use it within 30 days to request the results of the task at any time

‌‌‌‌
‌‌As a response of the API server, you will receive JSON-encoded data containing a tasks array with the information specific to the set tasks.

You can also get all available SERP features by making a request to the following Sandbox URL:
https://sandbox.dataforseo.com/v3/merchant/amazon/asin/task_get/advanced/00000000-0000-0000-0000-000000000000
The response will include all available items in the Amazon ASIN Advanced endpoint with the fields containing dummy data.
You won’t be charged for using Sandbox endpoints.

Description of the fields in the results array:

Field name Type Description
version string the current version of the API
status_code integer general status code
you can find the full list of the response codes here
Note: we strongly recommend designing a necessary system for handling related exceptional or error conditions
status_message string general informational message
you can find the full list of general informational messages here
time string execution time, seconds
cost float total tasks cost, USD
tasks_count integer the number of tasks in the tasks array
tasks_error integer the number of tasks in the tasks array that were returned an error
tasks array array of tasks
        id string task identifier
unique task identifier in our system in the UUID format
        status_code integer status code of the task
generated by DataForSEO; can be within the following range: 10000-60000
you can find the full list of the response codes here
        status_message string informational message of the task
you can find the full list of general informational messages here
        time string execution time, seconds
        cost float cost of the task, USD
        result_count integer number of elements in the result array
        path array URL path
        data object contains the same parameters that you specified in the POST request
        result array array of results
            asin string ASIN received in a POST array
the unique product identifier in Amazon (ASIN) received in a POST array
learn more about the identified in this help center guide
            type string search engine type in a POST array
possible values: shopping
            se_domain string Amazon domain in a POST array
            location_code integer location code in a POST array
            language_code string language code in a POST array
            check_url string direct URL to Amazon results
you can use it to make sure that we provided accurate results
            datetime string date and time when the result was received
in the UTC format: “yyyy-mm-dd hh-mm-ss +00:00”
example:
2019-11-15 12:57:46 +00:00
            spell object autocorrection of the search engine
if the search engine provided results for a keyword that was corrected, we will specify the keyword corrected by the search engine and the type of autocorrection
            item_types array types of search results found on Amazon
contains types of all search results (items) found in the returned SERP
possible item types:
amazon_product_info
            items_count integer the number of results returned in the items array
            items array Amazon product info items
                type string type of element = ‘amazon_product_info’
                rank_group integer position within a group of elements with identical type values
positions of elements with different type values are omitted from rank_group
                rank_absolute integer absolute rank
absolute position among all the elements in the response array
                position string the alignment of the element in Amazon SERP
possible values:
left, right
                xpath string the XPath of the element
                title string product title
                details string product specs and other details
                image_url string the URL of the product image
                author string product brand name
                data_asin string ASIN of the product received in a POST array
                parent_asin string parent ASIN of the product
                product_asins array ASINs of all found product modifications
                price_from float the lower limit of the product price range
example:
49.98
                price_to float the upper limit of the product price range
example:
384.99
                currency string currency in the ISO format
example:
USD
                is_amazon_choice boolean “Amazon’s choice” label
if the value is true, the product is marked with the “Amazon’s choice” label
                rating object product rating info
                    type string type of element = ‘rating_element’
                    position string the alignment of the element in Amazon SERP
possible values:
left, right
                    rating_type string the type of rating
here you can find the following elements: Max5, Percents, CustomMax
                    value string the value of the rating
                    votes_count integer the amount of feedback given to a product
                    rating_max string the maximum value for a rating_type
                is_newer_model_available boolean indicates whether the newer model of the product is available
                newer_model object information about the newer model of the product
                   title string product title
                   newer_model_asin string ASIN of the newer product model
                categories array contains related product categories
                   category string product category name
                   url string product category URL
indicates the browse path on Amazon with the unique browse node ID (product category ID on Amazon)
                product_information array contains related product information
                   type string type of element = ‘product_information_extended_item’
                   section_name string name of the section related to product information specified in the contents
                   contents array contains information specified about the product within the section_name
                       type string type of element = ‘product_information_rows’
                       title string title under which related product information appears on the Amazon product page
                       rows array rows containing related product information
                           type string type of element = ‘product_information_text_row’
                           text string text specified under the given title within the section_name
                           type string type of element = ‘product_information_image_row’
                           alt string alternative text of the related product image
                           url string URL of the image
                           type string type of element = ‘product_information_video_row’
                           preview string URL of the preview image for the related video
                           url string URL of the video
                   type string type of element = ‘product_information_details_item’
                   section_name string name of the section related to product information specified in the body
                   body object contains information specified about the product within the section_name
                product_images_list array contains URLs for all images of the product displayed on the left side of the main image
                product_videos_list array contains URLs for all videos of the product displayed on the right side of the main video
                description string contains description of the product
                is_available boolean indicates whether the product is available for ordering
if the value is true, the product can be ordered

‌‌