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

# Endpoints

> Complete reference of all available endpoints

<Note>
  All API endpoints are protected with API key authentication. You must
  include a valid API key in the Authorization header with each request.
  [Email us](mailto:founders@new-gen.ai) and we'll help you get set up.
</Note>

## Authentication

To authenticate with the API, include your API key in the `Authorization` header of your requests.

### Example

```bash theme={null}
curl -X GET "https://api.new-gen.ai/v1/products/search?q=shoes" \
  -H "Authorization: YOUR_API_KEY"
```

If you're using a client library:

```javascript theme={null}
// JavaScript example
const response = await fetch(
    "https://api.new-gen.ai/v1/products/search?q=shoes",
    {
        headers: {
            Authorization: "YOUR_API_KEY",
        },
    },
);
```

```python theme={null}
# Python example
import requests

headers = {
    'Authorization': 'YOUR_API_KEY'
}

response = requests.get('https://api.new-gen.ai/v1/products/search?q=shoes', headers=headers)
```

### Obtaining an API Key

[Email us](mailto:founders@new-gen.ai) to obtain an API key and we'll help you get set up. API keys should be kept secure and not shared.

## Product Search

```bash theme={null}
curl GET /api/v1/products/search
```

Search for products using text queries and LLM reranking.

### Query Parameters

| Parameter          | Type    | Description                                            |
| ------------------ | ------- | ------------------------------------------------------ |
| q                  | string  | Search query text (required)                           |
| brand\_url         | string  | Base brand URL to filter by, e.g., nike.com (optional) |
| limit              | number  | Maximum number of results (default: 20)                |
| include\_raw\_data | boolean | Include raw html/json data from pdp (default: false)   |

***

## Get a Product by ID

```bash theme={null}
curl GET /api/v1/products/:id
```

Retrieve a product by its ID.

### Path Parameters

| Parameter | Type   | Description |
| --------- | ------ | ----------- |
| id        | string | Product ID  |

### Query Parameters

| Parameter          | Type    | Description                                          |
| ------------------ | ------- | ---------------------------------------------------- |
| include\_raw\_data | boolean | Include raw html/json data from pdp (default: false) |

***

## Filter Products by URL

```bash theme={null}
curl GET /api/v1/products?url={url}
```

Retrieve a product by its URL.

### Query Parameters

| Parameter          | Type    | Description                                          |
| ------------------ | ------- | ---------------------------------------------------- |
| url                | string  | The product URL to fetch                             |
| include\_raw\_data | boolean | Include raw html/json data from pdp (default: false) |

***

## Health Check

```bash theme={null}
GET /health
```

Check API health status.
