# Quick Start

{% hint style="info" %}
**Two APIs to go live:** This quick start guide will take you through the two APIs required for you to go live with Neuralens AI search: Indexing, and Search.
{% endhint %}

## Get your API keys

Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error.

## Indexing API

Indexing is how you add your products to the search engine. For better understanding by the Neuralens Engine and better relevance, refer the set of [standardized fields](/reference/api-reference/indexing.md#standardized-fields). If you product attributes are not in the standardized set, you can use [custom field names](/reference/api-reference/indexing.md#custom-fields).

<mark style="color:green;">`POST`</mark> `https://api.neuralens.ai/search/index`

Indexes a new product. You can index up to 100 products in a single request.

Indexing is asynchronous. It may take up to an hour for newly indexed products to reflect in Search.

#### Request Headers

| Header                     | Value                       |
| -------------------------- | --------------------------- |
| X-Neuralens-API-Key        | Bearer YOUR\_API\_KEY\_HERE |
| X-Neuralens-Application-ID | YOUR\_APPLICATION\_ID       |

#### Request Body

```json
products: [
    {
        "id": "AD176",
        "title": "Printed T-shirt",
        "categories": ["Women", "Topwear", "Tshirts"],
        "productUrl": "https://example.com/product/id/AD176",
        "images": ["https://cdn.example.com/123", "https://cdn.example.com/789"],
        "currency": "USD",
        "listPrice": 18.99,
        "salePrice": 14.99,
        "size": "L",
        "fabricPrimary": "Cotton",
        "fabricOthers": ["Viscose"],
        "brand": "H&M",
    },
    {
        ...
    }
]
```

#### Explore Indexing API

{% content-ref url="/pages/YPkLgsN7B75ucoTuEFRQ" %}
[Indexing](/reference/api-reference/indexing.md)
{% endcontent-ref %}

## Search API

Use the Search API to query the indexed products. The Search API is also used to apply any sorts or filters.

<mark style="color:green;">`POST`</mark> `https://api.neuralens.ai/search/query`

#### Request Headers

| Header                     | Value                       |
| -------------------------- | --------------------------- |
| X-Neuralens-API-Key        | Bearer YOUR\_API\_KEY\_HERE |
| X-Neuralens-Application-ID | YOUR\_APPLICATION\_ID       |

#### Request Body

```json
{
    "query": "shirt",
    "offset": 0,
    "limit": 20,
    "filters": [
        {
            "field": "brand",
            "values": ["H&M", "Lacoste", "Nike"]
        }
    ],
    "fields": ["id", "productUrl", "title", "images"],
    "sort": "price",
    "sortOrder": "desc",
    "analytics": {
        "userId": "8769"
    }
}
```

#### Response&#x20;

```json
{
    "qid": "59f7e4d1-1364-4903-9f92-8691af26d7e2",
    "hasNextPage": true,
    "results": [    
        {
            "id": "AD176",
            "title": "Printed T-shirt",
            "images": ["https://cdn.example.com/123", "https://cdn.example.com/789"],
            "productUrl": "https://example.com/product/AD176"
        },
        {
            ...
        }
    ],
    "filters": [
        {
            "field": "size",
            "label": "Size",
            "values": ["S", "M", "L", "XL", "XXL"],
            "is_applied": false
        },
        ...
    ],
    "sorts": [
        {
            "field": "relevance",
            "order": "desc",
            "label": "Relevance",
            "is_applied": true
        },
        {
            "field": "price",
            "order": "asc",
            "label": "Price - Low to High",
            "is_applied": false
        },
        ...
    ]
    "pagination": {
        "total": 45,
        "current_offset": 0,
        "next_offset": 20
    }
}
```

#### Explore Search API

{% content-ref url="/pages/nyFhqw1VFyeCgz9Vacee" %}
[Search](/reference/api-reference/search.md)
{% endcontent-ref %}


---

# 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.neuralens.ai/quick-start.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.
