Serverless AI Data Search

AI powered data search service that finds the most relevant items from a collection based on a semantic search query.

Endpoint

Search through a collection of items using AI-powered semantic search

POSThttps://api.xtartapp.com/data/search

*Authentication

You must use a Bearer token provided by the dashboard to use for authentication. Add the token to the Authorization header.

Request body

NameTypeRequiredMaxDescription
querystringYes250The search query to find relevant items
itemsarrayYes100Array of items to search through. Maximum 100 items.
items[].idstringYes30The unique identifier for the item. Maximum 30 characters.
items[].titlestringYes100The title of the item. Maximum 100 characters.
items[].descriptionstringNo200Optional description of the item. Maximum 200 characters.
limitnumberNo25The maximum number of results to return. Default is 1, maximum is 25.

Response

NameTypeDescription
dataobjectThe data of the search process
data.resultsarrayArray of search results ordered by relevance
data.results[].idstringID of the matched item
data.results[].titlestringTitle of the matched item
data.results[].descriptionstringDescription of the matched item
data.results[].scorenumberRelevance score between 0 and 1, where 1 is most relevant
data.totalMatchesnumberTotal number of potential matches found
metadataobjectMetadata about the data search process
metadata.costnumberThe cost of the data search request (fixed at $0.0005 per request)
metadata.tokensnumberNumber of tokens used in the operation

Errors

{
   "error": "string", 
   "code": "string"
}
HTTP StatusError CodeMessage
400INVALID_PAYLOADOccurs when the payload is invalid.
400INVALID_REQUESTEx.: The request is invalid.
400DATA_SEARCH_ERROREx: could not search data | parsing error
400HARM_CONTENTEx.: The content is harmful and cannot be processed.
400INSUFFICIENT_BALANCEThe user has insufficient balance
401UNAUTHORIZEDEx.: The token is invalid.
429TOO_MANY_REQUESTSEx.: The request limit has been reached.