# 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.searchagora.com/search/query-categorization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
