Semantic search over indexed document content
curl --request GET \
--url https://api.us.lexful.app/v1/search/semantic \
--header 'Authorization: Bearer <token>' \
--header 'X-Account-ID: <x-account-id>'import requests
url = "https://api.us.lexful.app/v1/search/semantic"
headers = {
"X-Account-ID": "<x-account-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Account-ID': '<x-account-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api.us.lexful.app/v1/search/semantic', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.us.lexful.app/v1/search/semantic",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-Account-ID: <x-account-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.us.lexful.app/v1/search/semantic"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Account-ID", "<x-account-id>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.us.lexful.app/v1/search/semantic")
.header("X-Account-ID", "<x-account-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us.lexful.app/v1/search/semantic")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Account-ID"] = '<x-account-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"type": "system.document",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"preview": "<string>",
"similarity_score": 123,
"updated_at": "2023-11-07T05:31:56Z",
"source": "body",
"organization_name": "<string>"
}
],
"limit": 123
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}Search
Semantic search over indexed document content
Vector-similarity search over indexed document bodies and attachments. Returns at most one result per document, best match first.
GET
/
v1
/
search
/
semantic
Semantic search over indexed document content
curl --request GET \
--url https://api.us.lexful.app/v1/search/semantic \
--header 'Authorization: Bearer <token>' \
--header 'X-Account-ID: <x-account-id>'import requests
url = "https://api.us.lexful.app/v1/search/semantic"
headers = {
"X-Account-ID": "<x-account-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Account-ID': '<x-account-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api.us.lexful.app/v1/search/semantic', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.us.lexful.app/v1/search/semantic",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-Account-ID: <x-account-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.us.lexful.app/v1/search/semantic"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Account-ID", "<x-account-id>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.us.lexful.app/v1/search/semantic")
.header("X-Account-ID", "<x-account-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us.lexful.app/v1/search/semantic")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Account-ID"] = '<x-account-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"type": "system.document",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"preview": "<string>",
"similarity_score": 123,
"updated_at": "2023-11-07T05:31:56Z",
"source": "body",
"organization_name": "<string>"
}
],
"limit": 123
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}Authorizations
Bearer token
Headers
Account ID
Query Parameters
Search term (required)
Minimum string length:
1Maximum number of documents to return
Required range:
1 <= x <= 20Comma-separated list of organization IDs to filter by
Was this page helpful?