Bearer authentication header of the form Bearer <API_KEY>
, where <API_KEY>
is your organization’s API key.
Body
The project ID to perform the search on. This is displayed in the “Project Details” card on the project page.
The search query string. For example, “companies that require HIPAA compliance”
The number of batches of synthetic data to generate for the search. This parameter may range from 10 to 70. Increasing this may improve search quality but will increase response time.
The maximum number of results to return. This parameter may range from 1 to Infinity. Changing this parameter will not affect search time.
The filter query string which enables you to filter the search results using the filter columns in the dataset. Learn more about filter queries here .
Success Response
The state of the search will be “success” to indicate that the search was successful.
The tags associated with the search results
The probability that the result matches the search query, ranging from 0 to 1.
The labels associated with the search results. 0 means the result does not match the search query, 1 means the result matches the search query.
This field is always true if the search was successful.
This field is always null if the search was successful.
fetch ( 'https://api.search-artemis.com/search' , {
method: 'POST' ,
headers: {
'Authorization' : `Bearer YOUR_API_KEY` ,
'Content-Type' : 'application/json'
},
body: JSON . stringify ({
projectId: 'YOUR_PROJECT_ID' ,
searchQuery: 'companies that require HIPAA compliance' ,
filterQuery: 'company_size == "large"' ,
numberOfBatches: 50 ,
topK: 4 ,
})
})
. then ( response => response . json ())
{
"data" : {
"state" : "success" ,
"tags" : [
"Acme Healthcare Solutions" ,
"HealthGuard Technologies" ,
"PatientPrivacy Inc." ,
"Compliance Med"
],
"proba" : [
0.95 ,
0.89 ,
0.87 ,
0.85
],
"labels" : [
1 ,
0 ,
1 ,
0
]
},
"success" : true ,
"error" : null
}
Error Response
This field is always null if the search was not successful.
Indicates the search was not successful.
An error object containing the error message and code. The error code. Refer to the table below for possible error codes. Error Code Description invalid_json
The request body is not valid JSON. invalid_request_body
The request body schema did not match the expected schema. internal_server_error
An internal server error occurred. Please contact support. no_bearer_token
The request is missing the Authorization
header. invalid_bearer_token
The API key is invalid. filter_columns_not_found
The filter query attempted to filter on a column that does not exist. filter_query_error
The filter query is not valid. Learn more about filter queries here . dataset_embedding_not_found
The dataset uploaded is missing the ‘embedding’ column. dataset_tag_not_found
The dataset uploaded is missing the ‘tag’ column. dataset_empty
The dataset uploaded is empty. invalid_top_k
The top K is not valid. It must be an integer between 1 and Infinity. invalid_number_of_batches
The number of batches is not valid. It must be an integer between 10 and 70. invalid_search_query
The search query is invalid. It must be a non-empty string.
The error message explaining the error in detail.