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

# Contextual Search

> How to use Embeddings API for performing Contextual Search.

To use the Vector Database, please go through the detailed information from the [Embeddings API Documentation](https://docs.stockinsights.ai/api-reference/india_endpoints/filings-embeddings-search).

<Note>
  If you don't have an API key, generate one from the dashboard [Getting your API key to authenticate requests](https://docs.stockinsights.ai/api-reference/authentication).
</Note>

## Example

Below is a Python example demonstrating how to make a request to the API to perform a contextual search:

```python theme={null}

import requests
import json

def retrieve_similar_filings_chunks(query):
    url = 'https://stockinsights-ai-main-49970eb.d2.zuplo.dev/api/in/v0/documents/embeddings-search'
    headers = {'Content-Type': 'application/json',
              'Authorization': 'Bearer YOUR_API_KEY_HERE'}
    data = {
        "query": query,
        "filters": {
            "types": ["earnings-transcript", "annual-report"],
            'year': '2024'
        }
    }

    response = requests.post(url, headers=headers, data=json.dumps(data))
    return response.json()
    
result = retrieve_similar_filings_chunks("FIIs contribution to Indian Capital Markets")
```

## Key Points

* Replace YOUR\_API\_KEY\_HERE with your actual API key in the Authorization header.
* Modify the query parameter to suit your search needs.
* Adjust the filters to target specific document types or time periods.
