WebScrapingAPI Docs
Marketplace APIsAmazon Search APIAmazon Search Types

Amazon Bestsellers

Easily scrape the best-selling Amazon products by using the Amazon API.

Amazon Bestsellers

Easily scrape the best-selling Amazon products by using the Amazon API.

To enable this feature, set the type=bestsellers parameter.

Real-time analysis of Amazon's best-selling products is one of the most important requirements of any business selling on or interacting with Amazon. The Amazon Bestsellers feature returns a formatted JSON object with real-time best-selling Amazon products.

Amazon Bestsellers Parameters

The Amazon Bestsellers feature only takes two specific parameters:

ParameterRequiredTypeDescription
category_id✅stringThe ID of the category you are searching for. Use it together with parent_alias when searching for sub-categories.
parent_alias❌stringSpecify the parent category alias when searching for sub-categories.

Your full GET request should then be sent to the following address:

https://ecom.webscrapingapi.com/v1?engine=amazon&api_key=<YOUR_API_KEY>&type=bestsellers&category_id=<CATEGORY_ID>&parent_alias=<PARENT_ALIAS>

Amazon Bestsellers Integration Examples

curl --get "https://ecom.webscrapingapi.com/v1" \
  --data-urlencode "engine=amazon" \
  --data-urlencode "api_key=<YOUR_API_KEY>" \
  --data-urlencode "type=bestsellers" \
  --data-urlencode "category_id=electronics"
const API_KEY = "<YOUR_API_KEY>";
const SCRAPER_URL = "https://ecom.webscrapingapi.com/v1";

const params = new URLSearchParams({
  engine: "amazon",
  api_key: API_KEY,
  type: "bestsellers",
  category_id: "electronics",
});

const response = await fetch(`${SCRAPER_URL}?${params}`);
const data = await response.text();

console.log(data);
import requests

API_KEY = "<YOUR_API_KEY>"
SCRAPER_URL = "https://ecom.webscrapingapi.com/v1"

PARAMS = {
    "engine": "amazon",
    "api_key": API_KEY,
    "type": "bestsellers",
    "category_id": "electronics",
}

response = requests.get(SCRAPER_URL, params=PARAMS)

print(response.text)
<?php

$apiKey = '<YOUR_API_KEY>';
$scraperUrl = 'https://ecom.webscrapingapi.com/v1';

$query = http_build_query([
    'engine' => 'amazon',
    'api_key' => $apiKey,
    'type' => 'bestsellers',
    'category_id' => 'electronics',
]);

$response = file_get_contents("{$scraperUrl}?{$query}");

echo $response;
package main

import (
    "fmt"
    "io"
    "net/http"
    "net/url"
)

func main() {
    apiKey := "<YOUR_API_KEY>"
    baseURL := "https://ecom.webscrapingapi.com/v1"

    params := url.Values{}
    params.Add("engine", "amazon")
    params.Add("api_key", apiKey)
    params.Add("type", "bestsellers")
    params.Add("category_id", "electronics")

    req, _ := http.NewRequest("GET", baseURL+"?"+params.Encode(), nil)
    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()

    body, _ := io.ReadAll(res.Body)
    fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        String apiKey = "<YOUR_API_KEY>";
        String url = "https://ecom.webscrapingapi.com/v1"
    + "?engine=amazon"
    + "&api_key=" + apiKey
    + "&type=bestsellers"
    + "&category_id=electronics";

        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create(url))
            .GET()
            .build();

        HttpResponse<String> response = HttpClient.newHttpClient().send(
            request,
            HttpResponse.BodyHandlers.ofString()
        );

        System.out.println(response.body());
    }
}
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var apiKey = "<YOUR_API_KEY>";
        var url = "https://ecom.webscrapingapi.com/v1"
    + "?engine=amazon"
    + "&api_key=" + apiKey
    + "&type=bestsellers"
    + "&category_id=electronics";

        using var client = new HttpClient();
        var response = await client.GetAsync(url);
        var body = await response.Content.ReadAsStringAsync();

        Console.WriteLine(body);
    }
}
require "net/http"
require "uri"

api_key = "<YOUR_API_KEY>"
uri = URI("https://ecom.webscrapingapi.com/v1")
uri.query = URI.encode_www_form({
  engine: "amazon",
  api_key: api_key,
  type: "bestsellers",
  category_id: "electronics",
})

response = Net::HTTP.get_response(uri)

puts response.body

Response example

{
  "search_parameters": {
    "amazon_url": "https://www.amazon.com/gp/bestsellers/electronics",
    "engine": "amazon",
    "amazon_domain": "amazon.com",
    "device": "desktop",
    "type": "bestsellers",
    "category_id": "electronics"
  },
  "search_information": {
    "organic_results_state": "Results for exact spelling"
  },
  "category_results": {
    "product_results": [
      {
        "position": 1,
        "product_id": "B08C1W5N87",
        "title": "Fire TV Stick with Alexa Voice Remote",
        "link": "/fire-tv-stick-with-3rd-gen-alexa-voice-remote/dp/B08C1W5N87",
        "price": "$19.99",
        "rating": {
          "rating": "4.7 out of 5 stars",
          "total_ratings": 141438
        }
      }
    ]
  }
}

On this page