> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hibonsai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search v2

> Search products and contexts using the v2 endpoint

## Endpoint

`GET /rest/search/v2/`

`GET /rest/search/v2/{shop_id}/`

## Query Parameters

<ParamField query="q" type="string" required>
  Search query string.
</ParamField>

<ParamField query="shop_id" type="string">
  Filter to one or more shops.
</ParamField>

<ParamField query="products_only" type="boolean" default="false">
  Return only products when `true`.
</ParamField>

<ParamField query="skip_scoring" type="boolean" default="false">
  Skip LLM scoring when `true`.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.hibonsai.com/rest/search/v2/?q=humidifier" \
    -H "X-API-Key: YOUR_API_KEY_HERE"
  ```
</RequestExample>

<RequestExample>
  ```bash cURL (multiple shops) theme={null}
  curl -X GET "https://api.hibonsai.com/rest/search/v2/?q=humidifier&shop_id=shop-1&shop_id=shop-2" \
    -H "X-API-Key: YOUR_API_KEY_HERE"
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "results": [
      {
        "id": "product-uuid",
        "type": "product",
        "name": "Product Name",
        "description": "Product description",
        "image": "https://example.com/image.jpg",
        "images": ["https://example.com/image1.jpg"],
        "slug": "product-slug",
        "publicUrl": "https://example.com/products/product-slug",
        "publishedAt": "2024-01-01T00:00:00Z",
        "vendor": "Vendor Name",
        "tags": ["tag1", "tag2"],
        "productType": "Product Type",
        "price": "99.99",
        "compareAtPrice": "129.99"
      },
      {
        "id": "context-uuid",
        "type": "context",
        "name": "Shop Context Name",
        "description": "Context description",
        "image": null,
        "images": [],
        "slug": null,
        "publicUrl": "https://example.com/context",
        "publishedAt": "2024-01-01T00:00:00Z",
        "vendor": null,
        "tags": [],
        "productType": null,
        "price": null,
        "compareAtPrice": null
      }
    ],
    "count": 2
  }
  ```
</ResponseExample>

## Response Fields

| Field | Type | Description |
| - | - | - |
| `results` | array | Array of search results |
| `results[].id` | string | Unique identifier (UUID) |
| `results[].type` | string | Result type: `"product"` or `"context"` |
| `results[].name` | string | Product or context name |
| `results[].description` | string | Description text |
| `results[].image` | string\|null | Primary image URL |
| `results[].images` | array | Array of image URLs |
| `results[].slug` | string\|null | URL-friendly identifier |
| `results[].publicUrl` | string\|null | Public URL to the product/context |
| `results[].publishedAt` | string\|null | ISO 8601 timestamp |
| `results[].vendor` | string\|null | Vendor name |
| `results[].tags` | array | Array of tag strings |
| `results[].productType` | string\|null | Product type/category |
| `results[].price` | string\|null | Price as string |
| `results[].compareAtPrice` | string\|null | Compare at price (original price) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.