WebScrapingAPI Docs
Marketplace APIsAmazon Search APIAmazon Search Types

Amazon Category

Scrape Amazon products by category in real time.

Amazon Category

Scrape Amazon products by category, in real time via our ready-to-use REST API.

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

The Amazon Category feature should be used when scraping Amazon products by category. This feature returns a JSON object with the available products in the specified category. The main keys included in the JSON object are:

  • search_information
  • product_results

Amazon Category Parameters

The Amazon Category feature only takes one specific parameter:

ParameterRequiredTypeDescription
category_id✅stringThe ID of the category you are searching for. You can use both alias or numerical ID for parent 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=category&category_id=<CATEGORY_ID>

Amazon Category Integration Examples

curl --get "https://ecom.webscrapingapi.com/v1" \
  --data-urlencode "engine=amazon" \
  --data-urlencode "api_key=<YOUR_API_KEY>" \
  --data-urlencode "type=category" \
  --data-urlencode "category_id=amazon-devices"
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: "category",
  category_id: "amazon-devices",
});

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": "category",
    "category_id": "amazon-devices",
}

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' => 'category',
    'category_id' => 'amazon-devices',
]);

$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", "category")
    params.Add("category_id", "amazon-devices")

    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=category"
    + "&category_id=amazon-devices";

        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=category"
    + "&category_id=amazon-devices";

        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: "category",
  category_id: "amazon-devices",
})

response = Net::HTTP.get_response(uri)

puts response.body

Response example

{
  "search_parameters": {
    "amazon_url": "https://www.amazon.com/Amazon-Devices/b?ie=UTF8&node=2102313011",
    "engine": "amazon",
    "amazon_domain": "amazon.com",
    "device": "desktop",
    "type": "category",
    "category_id": "amazon-devices"
  },
  "search_information": {
    "organic_results_state": "Results for exact spelling",
    "query_displayed": ""
  },
  "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",
        "currency": "$",
        "rating": {
          "rating": "4.7 out of 5 stars",
          "total_ratings": 141438
        }
      }
    ]
  }
}

On this page