---
title: "Categorize a product"
description: "Find the SureBright category of a product from its page URL or from the product details you already have."
---

A plan is priced by category, so before you can quote a product that is not in a store catalog SureBright has indexed, you need its SureBright category (`sbCategoryId`). These endpoints read a product page or take the details you send, classify the product, and return the category together with what was read. Use the `v2` endpoints; the older ones remain for existing integrations.

No authentication header is needed for these endpoints.

| Endpoint | Input | Use |
|----------|-------|-----|
| `GET /quote/api/v2/productCategory/getProductDetails` | Product page URL | Read and classify a page |
| `POST /quote/api/v2/productCategory/getProductCategory` | Product details in the body | Classify without fetching the page |
| `GET /quote/api/productCategory/getProductDetails` | Product page URL | Previous reader; same shape with a legacy mapping block |
| `GET /quote/api/productCategory` | Product page URL | Original classifier; kept for existing callers |

## Classify a product page

`GET https://{HOST_NAME}/quote/api/v2/productCategory/getProductDetails`

<ParamField query="base64ProductURL" type="string" required>
  The product page URL, Base64-encoded (UTF-8).
</ParamField>
<ParamField query="vectorId" type="string">
  Your own reference for this product; echoed back. One is generated when omitted.
</ParamField>
<ParamField query="useCache" type="string">
  `0` or `false` to re-read the page instead of returning the cached result for this URL.
</ParamField>

```bash
URL=$(printf '%s' 'https://www.example-store.com/products/aero-2-electric-scooter' | base64)
curl "https://{HOST_NAME}/quote/api/v2/productCategory/getProductDetails?base64ProductURL=${URL}"
```

### Response

<ResponseField name="isError" type="boolean">
  `false` when the page was read.
</ResponseField>
<ResponseField name="url" type="string">
  The decoded URL.
</ResponseField>
<ResponseField name="vectorId" type="string">
  Your reference, or the generated one.
</ResponseField>
<ResponseField name="productData" type="object">
  What was read and decided about the product.
  <Expandable title="fields">
    <ResponseField name="title" type="string">Product title.</ResponseField>
    <ResponseField name="description" type="string">Product description.</ResponseField>
    <ResponseField name="price" type="string">Price as shown on the page.</ResponseField>
    <ResponseField name="imageURL" type="string">Main image.</ResponseField>
    <ResponseField name="platform" type="string">The storefront platform detected.</ResponseField>
    <ResponseField name="storeCategoryTagList" type="string[]">
      The category path the classifier assigned, broad to narrow.
    </ResponseField>
    <ResponseField name="sbCategoryId" type="string">
      The SureBright category, when the path maps to one.
    </ResponseField>
    <ResponseField name="sbCategoryName" type="string">
      Its name.
    </ResponseField>
    <ResponseField name="productCondition" type="string">
      New, refurbished or used, as inferred from the page.
    </ResponseField>
    <ResponseField name="usageType" type="string">
      Personal or commercial use, as inferred.
    </ResponseField>
  </Expandable>
</ResponseField>
<ResponseField name="status" type="string">
  `COMPLETED`.
</ResponseField>

Results are cached per URL. The same URL returns the cached result until you pass `useCache=0`.

## Classify from product details

`POST https://{HOST_NAME}/quote/api/v2/productCategory/getProductCategory`

Use this when you already have the product fields, for example from your own catalog feed, and do not want SureBright to fetch the page.

<ParamField body="title" type="string" required>Product title.</ParamField>
<ParamField body="description" type="string" required>Product description.</ParamField>
<ParamField body="price" type="string" required>Price, for example `"899.00"`.</ParamField>
<ParamField body="imageURL" type="string" required>Main image URL.</ParamField>
<ParamField body="url" type="string">Product page URL. Used as the cache key, so send it when you have it.</ParamField>
<ParamField body="vectorId" type="string">Your own reference; echoed back.</ParamField>
<ParamField body="categories" type="string">Comma-separated category names from your store, to help the classifier.</ParamField>

```bash
curl -X POST 'https://{HOST_NAME}/quote/api/v2/productCategory/getProductCategory' \
  -H 'Content-Type: application/json' \
  -d '{
    "url": "https://www.example-store.com/products/aero-2-electric-scooter",
    "title": "Aero 2 Electric Scooter",
    "description": "Foldable commuter e-scooter, 350 W motor, 25 km range.",
    "price": "899.00",
    "imageURL": "https://www.example-store.com/cdn/aero-2.jpg",
    "categories": "Mobility, Electric scooters"
  }'
```

### Response

The same envelope as above (`isError`, `url`, `vectorId`, `productData`, `status`), plus:

<ResponseField name="categorizationStatus" type="string">
  `SUCCESS` when a category was assigned, otherwise `FAILED`.
</ResponseField>
<ResponseField name="category" type="string">
  The narrowest category label assigned.
</ResponseField>
<ResponseField name="insurerCategory" type="object">
  Legacy mapping block: `classifiedCategory` and `isCoverageAvailable` (`false` when the product fell into an uncovered bucket such as `OTHERS`). The other ids in it are internal.
</ResponseField>

## Older endpoints

`GET /quote/api/productCategory/getProductDetails?base64ProductURL=&vectorId=&useCache=` returns the page reading with the same legacy `insurerCategory` block and `status: "COMPLETED"`.

`GET /quote/api/productCategory?base64ProductURL=` (or `?vectorId=` to re-read an earlier result) returns `productData` with a `specifications` map that includes `Classified Category`, the legacy `insurerCategory` block, `status` and `vectorId`. It is slower and should not be used for new work.

## Errors

All four endpoints use the same codes.

| Code | Body | Meaning |
|------|------|---------|
| `400` | `{"isError": true, "message": "Insufficient params"}` | `base64ProductURL` (or `vectorId` on the original endpoint) missing |
| `400` | `{"isError": true, "message": "Insufficient data"}` | Empty body on the details endpoint |
| `400` | `{"isError": true, "message": "Error in getting product details"}` or `"Error in getting product category"` | The page could not be read, or `title`, `description`, `price` or `imageURL` is missing |
| `400` | `{"isError": true, "message": "Unable to scrape page"}`, `"No Product Data found"`, `"No Matching vectors found"` | Original endpoint only |
| `500` | `Internal Server Error` | Unexpected failure |

SureBright logs every request and response on these endpoints for quality review.
