# 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](https://docs.neuralens.ai/reference/api-reference/indexing#standardized-fields). If you product attributes are not in the standardized set, you can use [custom field names](https://docs.neuralens.ai/reference/api-reference/indexing#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="reference/api-reference/indexing" %}
[indexing](https://docs.neuralens.ai/reference/api-reference/indexing)
{% 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="reference/api-reference/search" %}
[search](https://docs.neuralens.ai/reference/api-reference/search)
{% endcontent-ref %}
