> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrapengine.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Shopee Product

> Get detailed product information from Shopee Indonesia by slug or item/shop IDs

## Overview

The `/shopee/product` endpoint retrieves detailed product information from Shopee Indonesia (shopee.co.id) including pricing, variants, ratings, stock, and seller details.

<Note>
  This endpoint uses **browser rendering** to bypass anti-bot protection. Requests may take longer compared to renderless endpoints.
</Note>

<Warning>
  Currently only Indonesia (country=id) is supported. More Southeast Asian markets will be added in future updates.
</Warning>

## Credits

**25 credits** per successful request.

## Parameters

### Query Parameters

<ParamField query="slug" type="string">
  Product slug containing the shop and item IDs (e.g., `Product-Name-i.SHOPID.ITEMID`).

  If provided, `itemId` and `shopId` are extracted automatically.
</ParamField>

<ParamField query="itemId" type="string">
  The Shopee product item ID (e.g., "22133637031"). Required if `slug` is not provided.
</ParamField>

<ParamField query="shopId" type="string">
  The Shopee shop/seller ID (e.g., "12651109"). Required if `slug` is not provided.
</ParamField>

<ParamField query="country" type="string" required>
  Country code. Currently only `id` (Indonesia) is supported.
</ParamField>

<Note>
  Either `slug` OR both `itemId` and `shopId` must be provided.
</Note>

## Example Requests

### Get Product by Slug (Recommended)

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.scrapengine.io/api/v1/shopee/product?slug=Gantungan-Handphone-Kristal-Ungu-i.12651109.22133637031&country=id" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const params = new URLSearchParams({
    slug: "Gantungan-Handphone-Kristal-Ungu-i.12651109.22133637031",
    country: "id",
  });

  const response = await fetch(
    `https://api.scrapengine.io/api/v1/shopee/product?${params}`,
    {
      headers: {
        Authorization: "Bearer YOUR_API_KEY",
      },
    }
  );

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.scrapengine.io/api/v1/shopee/product"
  headers = {"Authorization": "Bearer YOUR_API_KEY"}
  params = {
      "slug": "Gantungan-Handphone-Kristal-Ungu-i.12651109.22133637031",
      "country": "id"
  }

  response = requests.get(url, headers=headers, params=params)
  print(response.json())
  ```
</CodeGroup>

### Get Product by IDs

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.scrapengine.io/api/v1/shopee/product?shopId=12651109&itemId=22133637031&country=id" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const params = new URLSearchParams({
    shopId: "12651109",
    itemId: "22133637031",
    country: "id",
  });

  const response = await fetch(
    `https://api.scrapengine.io/api/v1/shopee/product?${params}`,
    {
      headers: {
        Authorization: "Bearer YOUR_API_KEY",
      },
    }
  );

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.scrapengine.io/api/v1/shopee/product"
  headers = {"Authorization": "Bearer YOUR_API_KEY"}
  params = {
      "shopId": "12651109",
      "itemId": "22133637031",
      "country": "id"
  }

  response = requests.get(url, headers=headers, params=params)
  print(response.json())
  ```
</CodeGroup>

## Response

### Success Response (200)

Returns detailed product information:

```json theme={null}
{
  "itemId": "22133637031",
  "shopId": "12651109",
  "name": "Gantungan Handphone Kristal Ungu Penutup Lubang Hp HPCRUU",
  "description": "Gantungan handphone kristal ungu dengan penutup lubang hp...",
  "link": "https://shopee.co.id/Gantungan-Handphone-Kristal-Ungu-i.12651109.22133637031",
  "images": [
    "https://down-id.img.susercontent.com/file/id-11134207-xxx.jpg",
    "https://down-id.img.susercontent.com/file/id-11134207-yyy.jpg"
  ],
  "price": 15000,
  "priceDisplay": "Rp15.000",
  "priceMin": 15000,
  "priceMax": 25000,
  "originalPrice": 20000,
  "discount": "-25%",
  "currency": "Rp",
  "stock": 150,
  "sold": 1234,
  "soldDisplay": "1,2RB terjual",
  "rating": 4.8,
  "ratingCount": 456,
  "ratingStar": 4.78,
  "brand": "Local Brand",
  "categories": ["Handphone & Aksesoris", "Gantungan Handphone"],
  "shopName": "Toko Aksesoris HP",
  "shopLocation": "Jakarta Pusat",
  "isOfficialShop": false,
  "isFreeShipping": true,
  "variants": [
    {
      "modelId": "137493209894",
      "name": "Charger Iphone",
      "price": 15000,
      "priceDisplay": "Rp15.000",
      "stock": 10
    },
    {
      "modelId": "137493209895",
      "name": "Type-C",
      "price": 15000,
      "priceDisplay": "Rp15.000",
      "stock": 10
    }
  ],
  "tierVariations": [
    {
      "name": "TIPE",
      "options": ["Charger Iphone", "Type-C", "Jack Aux"]
    }
  ],
  "attributes": {
    "Material": "Kristal",
    "Warna": "Ungu"
  },
  "likedCount": 1657,
  "commentCount": 116,
  "country": "id"
}
```

### Response Headers

| Header                | Description                       |
| --------------------- | --------------------------------- |
| `x-remaining-credits` | Number of API credits remaining   |
| `x-trace-id`          | Unique identifier for the request |

### Error Responses

| Status | Description                                                         |
| ------ | ------------------------------------------------------------------- |
| `400`  | Bad Request - Missing slug or itemId/shopId, or unsupported country |
| `401`  | Unauthorized - Invalid or missing API key                           |
| `404`  | Not Found - Product not found                                       |
| `500`  | Internal Server Error                                               |

## Extracting IDs from Shopee URL

Shopee product URLs follow this pattern:

```
https://shopee.co.id/Product-Name-i.SHOP_ID.ITEM_ID
```

For example, from this URL:

```
https://shopee.co.id/Gantungan-Handphone-Kristal-Ungu-i.12651109.22133637031
```

* `shopId` = `12651109`
* `itemId` = `22133637031`
* `slug` = `Gantungan-Handphone-Kristal-Ungu-i.12651109.22133637031`

## Use Cases

* **Product monitoring**: Track price changes and stock levels
* **Competitive analysis**: Monitor competitor product details
* **Inventory sync**: Sync product data with your own systems
* **Price comparison**: Compare prices across different sellers
* **Review aggregation**: Collect product ratings and review counts

## Notes

* This endpoint uses **browser rendering** which may result in longer response times
* Prices are in Indonesian Rupiah (IDR)
* The `variants` array contains all product variations with their individual prices and stock
* `ratingStar` is the precise rating value (e.g., 4.78), while `rating` is rounded
