Search within videos
curl --request POST \
--url https://api.trytldw.ai/v1/search/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"collection_id": "<string>",
"search_term": "<string>",
"media_ids": [
"<string>"
],
"similarity_threshold": 0.28,
"offset": 0,
"limit": 30,
"configs": {
"smart_remove_false_positive": false
},
"filter": {
"user_id": "1221"
}
}
'import requests
url = "https://api.trytldw.ai/v1/search/"
payload = {
"collection_id": "<string>",
"search_term": "<string>",
"media_ids": ["<string>"],
"similarity_threshold": 0.28,
"offset": 0,
"limit": 30,
"configs": { "smart_remove_false_positive": False },
"filter": { "user_id": "1221" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
collection_id: '<string>',
search_term: '<string>',
media_ids: ['<string>'],
similarity_threshold: 0.28,
offset: 0,
limit: 30,
configs: {smart_remove_false_positive: false},
filter: {user_id: '1221'}
})
};
fetch('https://api.trytldw.ai/v1/search/', 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.trytldw.ai/v1/search/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'collection_id' => '<string>',
'search_term' => '<string>',
'media_ids' => [
'<string>'
],
'similarity_threshold' => 0.28,
'offset' => 0,
'limit' => 30,
'configs' => [
'smart_remove_false_positive' => false
],
'filter' => [
'user_id' => '1221'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.trytldw.ai/v1/search/"
payload := strings.NewReader("{\n \"collection_id\": \"<string>\",\n \"search_term\": \"<string>\",\n \"media_ids\": [\n \"<string>\"\n ],\n \"similarity_threshold\": 0.28,\n \"offset\": 0,\n \"limit\": 30,\n \"configs\": {\n \"smart_remove_false_positive\": false\n },\n \"filter\": {\n \"user_id\": \"1221\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.trytldw.ai/v1/search/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"collection_id\": \"<string>\",\n \"search_term\": \"<string>\",\n \"media_ids\": [\n \"<string>\"\n ],\n \"similarity_threshold\": 0.28,\n \"offset\": 0,\n \"limit\": 30,\n \"configs\": {\n \"smart_remove_false_positive\": false\n },\n \"filter\": {\n \"user_id\": \"1221\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trytldw.ai/v1/search/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"collection_id\": \"<string>\",\n \"search_term\": \"<string>\",\n \"media_ids\": [\n \"<string>\"\n ],\n \"similarity_threshold\": 0.28,\n \"offset\": 0,\n \"limit\": 30,\n \"configs\": {\n \"smart_remove_false_positive\": false\n },\n \"filter\": {\n \"user_id\": \"1221\"\n }\n}"
response = http.request(request)
puts response.read_body{
"scenes": [
{
"media_id": "<string>",
"external_id": "<string>",
"start_ms": 123,
"end_ms": 123,
"max_similarity": 123,
"fragments": [
{
"uuid": "<string>",
"start_ms": 123,
"end_ms": 123,
"similarity": 123,
"description": "<string>"
}
]
}
],
"metadata": {}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Search Video Moments
Search within videos
POST
/
search
/
Search within videos
curl --request POST \
--url https://api.trytldw.ai/v1/search/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"collection_id": "<string>",
"search_term": "<string>",
"media_ids": [
"<string>"
],
"similarity_threshold": 0.28,
"offset": 0,
"limit": 30,
"configs": {
"smart_remove_false_positive": false
},
"filter": {
"user_id": "1221"
}
}
'import requests
url = "https://api.trytldw.ai/v1/search/"
payload = {
"collection_id": "<string>",
"search_term": "<string>",
"media_ids": ["<string>"],
"similarity_threshold": 0.28,
"offset": 0,
"limit": 30,
"configs": { "smart_remove_false_positive": False },
"filter": { "user_id": "1221" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
collection_id: '<string>',
search_term: '<string>',
media_ids: ['<string>'],
similarity_threshold: 0.28,
offset: 0,
limit: 30,
configs: {smart_remove_false_positive: false},
filter: {user_id: '1221'}
})
};
fetch('https://api.trytldw.ai/v1/search/', 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.trytldw.ai/v1/search/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'collection_id' => '<string>',
'search_term' => '<string>',
'media_ids' => [
'<string>'
],
'similarity_threshold' => 0.28,
'offset' => 0,
'limit' => 30,
'configs' => [
'smart_remove_false_positive' => false
],
'filter' => [
'user_id' => '1221'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.trytldw.ai/v1/search/"
payload := strings.NewReader("{\n \"collection_id\": \"<string>\",\n \"search_term\": \"<string>\",\n \"media_ids\": [\n \"<string>\"\n ],\n \"similarity_threshold\": 0.28,\n \"offset\": 0,\n \"limit\": 30,\n \"configs\": {\n \"smart_remove_false_positive\": false\n },\n \"filter\": {\n \"user_id\": \"1221\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.trytldw.ai/v1/search/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"collection_id\": \"<string>\",\n \"search_term\": \"<string>\",\n \"media_ids\": [\n \"<string>\"\n ],\n \"similarity_threshold\": 0.28,\n \"offset\": 0,\n \"limit\": 30,\n \"configs\": {\n \"smart_remove_false_positive\": false\n },\n \"filter\": {\n \"user_id\": \"1221\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trytldw.ai/v1/search/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"collection_id\": \"<string>\",\n \"search_term\": \"<string>\",\n \"media_ids\": [\n \"<string>\"\n ],\n \"similarity_threshold\": 0.28,\n \"offset\": 0,\n \"limit\": 30,\n \"configs\": {\n \"smart_remove_false_positive\": false\n },\n \"filter\": {\n \"user_id\": \"1221\"\n }\n}"
response = http.request(request)
puts response.read_body{
"scenes": [
{
"media_id": "<string>",
"external_id": "<string>",
"start_ms": 123,
"end_ms": 123,
"max_similarity": 123,
"fragments": [
{
"uuid": "<string>",
"start_ms": 123,
"end_ms": 123,
"similarity": 123,
"description": "<string>"
}
]
}
],
"metadata": {}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The collection UUID to search within
Example:
"c1a2b3c4-1a2b-3c4d-5e6f-7g8h9i0j1k2l"
The text query used for searching
Example:
"sunset beach"
A list of media UUIDs to filter the search
Example:
"m1a2b3c4-1a2b-3c4d-5e6f-7g8h9i0j1k2l"
The minimum similarity score required to presented in search results
Example:
0.28
The pagination offset for search results
Example:
10
The maximum number of search results to return
Example:
30
Additional configuration options for the search, such as removing false positives
Show child attributes
Show child attributes
Optional filters to apply to the search results. For now, it only supports matching value on metadata fields
Example:
{ "user_id": "1221" }
Was this page helpful?
⌘I