# Search HSCodes

## /hs-codes/search/query

<mark style="color:blue;">`GET`</mark> `https://api.terminal.africa/v1/hs-codes/search/query`

This endpoint allows you to search from the list of all hs codes available.

#### Query Parameters

| Name                                            | Type   | Description                                                                  |
| ----------------------------------------------- | ------ | ---------------------------------------------------------------------------- |
| perPage                                         | Number | Specify how many records will be sent in a single response. Defaults to 100. |
| page                                            | Number | Specify what page of records will be sent in response. Defaults to 1.        |
| query\_string<mark style="color:red;">\*</mark> | String | Query to search                                                              |

#### Headers

| Name                                            | Type   | Description                      |
| ----------------------------------------------- | ------ | -------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Set value to `Bearer SECRET_KEY` |

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

```json
{
    "status": true,
    "message": "Search results",
    "data": {
        "hs_codes": [
            {
                "_id": "641d65dfd1b41ab967641c9b",
                "chapter": "35",
                "category": "Casein, caseinates and other casein derivatives; casein glues (excl. those packaged as glue for retail sale and weighing net <= 1 kg)",
                "category_code": "3501",
                "sub_category": "Casein for the manufacture of artificial textile fibres",
                "hs_code": "35011010",
                "hs_code_id": "HS-58166557317",
                "__v": 0,
                "id": "641d65dfd1b41ab967641c9b"
            },
            {
                "_id": "641d65dfd1b41ab967641c9c",
                "chapter": "35",
                "category": "Casein, caseinates and other casein derivatives; casein glues (excl. those packaged as glue for retail sale and weighing net <= 1 kg)",
                "category_code": "3501",
                "sub_category": "Casein for industrial uses (excl. the manufacture of foodstuffs or fodder and artificial textile fibres)",
                "hs_code": "35011050",
                "hs_code_id": "HS-52565243769",
                "__v": 0,
                "id": "641d65dfd1b41ab967641c9c"
            },
            {
                "_id": "641d65dfd1b41ab967641c9d",
                "chapter": "35",
                "category": "Casein, caseinates and other casein derivatives; casein glues (excl. those packaged as glue for retail sale and weighing net <= 1 kg)",
                "category_code": "3501",
                "sub_category": "Casein for the manufacture of foodstuffs and fodder and other types of casein (excl. the manufacture of artificial textile fibres and other industrial uses)",
                "hs_code": "35011090",
                "hs_code_id": "HS-04289043889",
                "__v": 0,
                "id": "641d65dfd1b41ab967641c9d"
            }
        ],
        "pagination": {
            "page": 1,
            "perPage": 100,
            "prevPage": null,
            "nextPage": null,
            "currentPage": 1,
            "total": 28,
            "pageCount": 1,
            "pagingCounter": 1,
            "hasPrevPage": false,
            "hasNextPage": false
        }
    }
}
```

{% 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.terminal.africa/tship/hs-codes/search-hscodes.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.
