> For the complete documentation index, see [llms.txt](https://docs.searchagora.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.searchagora.com/search/text-search.md).

# Text search

GET `/search`

This endpoint lets you search for products based on parameters such as query, price range, sorting order, and more. Text search is used on Agora for objective search queries.

**Which search should I use?**

| Endpoint                                     | API key    | Use for                                                                            |
| -------------------------------------------- | ---------- | ---------------------------------------------------------------------------------- |
| `https://zues.searchagora.com/api/v1/search` | Required   | Apps, AI agents and backend integrations. Returns the response shown on this page. |
| `https://www.searchagora.com/api/search`     | Not needed | The /agent browser pages. Same products, but the response is wrapped in `data`.    |

**Headers**

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

**Query parameters**

| Parameter    | Type    | Description                                                                                         |
| ------------ | ------- | --------------------------------------------------------------------------------------------------- |
| `count`      | integer | Number of products to return per page. The default is 20. The maximum is 250.                       |
| `page`       | integer | Page number of pagination. The default is 1. Keep requesting the next page while `hasMore` is true. |
| `q`          | string  | Search query.                                                                                       |
| `priceRange` | array   | Price range filter \[minPrice, maxPrice].                                                           |
| `sort`       | string  | Sorting field: price or relevance.                                                                  |
| `order`      | string  | Sorting order: asc or desc.                                                                         |
| `imageId`    | string  | Image search identifier.                                                                            |

**Example request**

`GET https://zues.searchagora.com/api/v1/search?q=red%20shoes`

**Response**

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

```json
{
  "status": "success",
  "Products": [
        {
            "_id": "65d4d4f1b7bb634c6599ffd2",
            "name": "Calzuro Classic Without Holes Pistachio",
            "brand": "Calzuro",
            "storeName": "Calzuro",
            "slug": "calzuro-without-pistachio-eb12f468-48a2-48af-9f5e-3fda5f6c135c-1708446961787",
            "price": 111.99,
            "isVerified": true,
            "isBoosted": false,
            "images": [
                "https://cdn.shopify.com/s/files/1/0738/4442/4986/products/pistachio-calzuro-without-1.jpg?v=1682709875",
                "https://cdn.shopify.com/s/files/1/0738/4442/4986/files/pistachiocalzuro.png?v=1712343485",
                "https://cdn.shopify.com/s/files/1/0738/4442/4986/files/classicinfographic_26486960-c007-4661-b74d-b50e158115cc.png?v=1712343485",
                "https://cdn.shopify.com/s/files/1/0738/4442/4986/products/pistachio-calzuro-without-2.jpg?v=1712343483",
                "https://cdn.shopify.com/s/files/1/0738/4442/4986/products/pistachio-calzuro-without-3.jpg?v=1712343483",
                "https://cdn.shopify.com/s/files/1/0738/4442/4986/products/pistachio-calzuro-without-4.jpg?v=1712343483"
            ],
            "url": "https://calzuro.com/products/calzuro-without-pistachio",
            "agoraScore": 95,
            "priceHistory": [
                {
                    "price": 111.99,
                    "date": "2024-02-20T16:36:01.992Z",
                    "_id": "671499c36ca0a1804aca445f"
                }
            ],
            "discountVal": 0,
            "averageRating": 4.5
        }
    ],
    "hasMore": true,
    "count": 20
}
```

{% endtab %}

{% tab title="401" %}

```json
{
 "status": "error",
 "message": "API key is required"
}
```

{% endtab %}

{% tab title="500" %}

```json
{
 "status": "error",
 "message": "Internal Server Error"
}
```

{% endtab %}
{% endtabs %}
