API Documentation
Find Similar Cards
Endpoint
POST /api/data/cards/similar
Description
This API finds similar cards based on the input text. It queries a vector database using Upstash Vector to return the most relevant cards, ranked by similarity score.
Headers
Header |
Type |
Required |
Description |
Content-Type |
string |
Yes |
Set to application/json . |
x-api-key |
string |
Yes |
API key for authentication. |
Request Body
The request body should be a JSON object with the following fields:
Field |
Type |
Required |
Description |
inputText |
string |
Yes |
The input text to find similar cards for. |
topN |
number |
No |
The number of similar results to retrieve (default: 10). |
Example Request Body
{
"inputText": "What is the best longevity diet?",
"topN": 5
}
Response
Field |
Type |
Description |
results |
array |
An array of objects representing the similar cards found. |
Result Object Fields
Field |
Type |
Description |
id |
string |
The ID of the similar card. |
score |
number |
The similarity score (higher means more similar). |
metadata |
object |
Metadata associated with the similar card. |