# Query categorization

POST `/classify-query`

This endpoint lets you check the e-commerce category that a search query belongs to. For example, a search for "Nike shoes" would be classified into the category "Clothing, Shoes & Jewelry" and sub-category "Shoes".&#x20;

**Headers**

| Header          | Type   | Description   |
| --------------- | ------ | ------------- |
| `Authorization` | string | Bearer token. |

**Request body**

```json
{
  query:"Nike Shoes"
}
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  status:200,
  categoryClassification: {
        "subcategory_id": "679182011",
        "subcategory": "Shoes",
        "category_id": "7147443011",
        "category": "Clothing, Shoes & Jewelry"
    }
}
```

{% endtab %}

{% tab title="500" %}

```json
{
      status: "error",
      message: "Failed to classify query",
      error: "Error message generated",
}
```

{% endtab %}
{% endtabs %}
