# Search API

## Search

> Perform a vector similarity search (VSS) operation on a dataset.\
> \
> The search operation will return the most relevant matches based on cosine similarity with the input \`text\`.\
> The datasets queries should have an embedding column, and the appropriate embedding model loaded.

```json
{"openapi":"3.1.0","info":{"title":"Spice.ai Data-Platform","version":"1.0.0"},"tags":[],"servers":[{"description":"AWS Stamp, US East 1 region","url":"https://us-east-1-prod-aws-data.spiceai.io"},{"description":"AWS Stamp, US West 2 region","url":"https://us-west-2-prod-aws-data.spiceai.io"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"in":"header","name":"X-API-KEY","type":"apiKey"}},"schemas":{}},"paths":{"/v1/search":{"post":{"tags":["SQL"],"summary":"Search","description":"Perform a vector similarity search (VSS) operation on a dataset.\n\nThe search operation will return the most relevant matches based on cosine similarity with the input `text`.\nThe datasets queries should have an embedding column, and the appropriate embedding model loaded.","operationId":"post_search","requestBody":{"description":"Search request parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequestHTTPJson"}}},"required":true},"responses":{"200":{"description":"Search completed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"}}}},"400":{"description":"Invalid request parameters","content":{"application/json":{"schema":{}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{}}}}}}}}}
```


---

# 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.spice.ai/api/runtime-apis/search.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.
