Search collection content (semantic / keyword / image)
curl --request POST \
--url https://api.memories.ai/serve/datalake/v1/search \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"collection_id": "col_xxx",
"query": "a woman talking to the camera",
"mode": "semantic",
"targets": [
"caption"
],
"top_k": 20
}
'import requests
url = "https://api.memories.ai/serve/datalake/v1/search"
payload = {
"collection_id": "col_xxx",
"query": "a woman talking to the camera",
"mode": "semantic",
"targets": ["caption"],
"top_k": 20
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
collection_id: 'col_xxx',
query: 'a woman talking to the camera',
mode: 'semantic',
targets: ['caption'],
top_k: 20
})
};
fetch('https://api.memories.ai/serve/datalake/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.memories.ai/serve/datalake/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' => 'col_xxx',
'query' => 'a woman talking to the camera',
'mode' => 'semantic',
'targets' => [
'caption'
],
'top_k' => 20
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.memories.ai/serve/datalake/v1/search"
payload := strings.NewReader("{\n \"collection_id\": \"col_xxx\",\n \"query\": \"a woman talking to the camera\",\n \"mode\": \"semantic\",\n \"targets\": [\n \"caption\"\n ],\n \"top_k\": 20\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.memories.ai/serve/datalake/v1/search")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"collection_id\": \"col_xxx\",\n \"query\": \"a woman talking to the camera\",\n \"mode\": \"semantic\",\n \"targets\": [\n \"caption\"\n ],\n \"top_k\": 20\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memories.ai/serve/datalake/v1/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"collection_id\": \"col_xxx\",\n \"query\": \"a woman talking to the camera\",\n \"mode\": \"semantic\",\n \"targets\": [\n \"caption\"\n ],\n \"top_k\": 20\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"ref": "vid_xxx@25.0-32.0",
"video_id": "vid_xxx",
"target": "caption",
"score": 0.61,
"start": 25,
"end": 32,
"snippet": "The young woman, wearing headphones",
"thumbnail_url": "https://storage.googleapis.com/…(15-min signed)"
}
],
"next_cursor": "PMRHC5...",
"index_version": "idx_2026_06",
"embedding": {
"model": "omni_retriever",
"dimensions": 3072
},
"hint": null
}Search
Search Moments
Search collection content (semantic / keyword / image)
POST
/
datalake
/
v1
/
search
Search collection content (semantic / keyword / image)
curl --request POST \
--url https://api.memories.ai/serve/datalake/v1/search \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"collection_id": "col_xxx",
"query": "a woman talking to the camera",
"mode": "semantic",
"targets": [
"caption"
],
"top_k": 20
}
'import requests
url = "https://api.memories.ai/serve/datalake/v1/search"
payload = {
"collection_id": "col_xxx",
"query": "a woman talking to the camera",
"mode": "semantic",
"targets": ["caption"],
"top_k": 20
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
collection_id: 'col_xxx',
query: 'a woman talking to the camera',
mode: 'semantic',
targets: ['caption'],
top_k: 20
})
};
fetch('https://api.memories.ai/serve/datalake/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.memories.ai/serve/datalake/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' => 'col_xxx',
'query' => 'a woman talking to the camera',
'mode' => 'semantic',
'targets' => [
'caption'
],
'top_k' => 20
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.memories.ai/serve/datalake/v1/search"
payload := strings.NewReader("{\n \"collection_id\": \"col_xxx\",\n \"query\": \"a woman talking to the camera\",\n \"mode\": \"semantic\",\n \"targets\": [\n \"caption\"\n ],\n \"top_k\": 20\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.memories.ai/serve/datalake/v1/search")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"collection_id\": \"col_xxx\",\n \"query\": \"a woman talking to the camera\",\n \"mode\": \"semantic\",\n \"targets\": [\n \"caption\"\n ],\n \"top_k\": 20\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.memories.ai/serve/datalake/v1/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"collection_id\": \"col_xxx\",\n \"query\": \"a woman talking to the camera\",\n \"mode\": \"semantic\",\n \"targets\": [\n \"caption\"\n ],\n \"top_k\": 20\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"ref": "vid_xxx@25.0-32.0",
"video_id": "vid_xxx",
"target": "caption",
"score": 0.61,
"start": 25,
"end": 32,
"snippet": "The young woman, wearing headphones",
"thumbnail_url": "https://storage.googleapis.com/…(15-min signed)"
}
],
"next_cursor": "PMRHC5...",
"index_version": "idx_2026_06",
"embedding": {
"model": "omni_retriever",
"dimensions": 3072
},
"hint": null
}Product: Video Datalake
Host:
https://api.memories.ai/serve/datalake/v1
Auth: Authorization: sk-mai-...semantic (vector), keyword (BM25), and hybrid (RRF) modes, plus text-to-frame and image-to-frame. Each result’s ref can be fed straight into Get Moment.
Pricing: $0.008 / call · See Pricing for the full model.
Response Fields
array
Moment hits with
ref, score, snippet, thumbnail_url.string
Feed into Get Moment to expand.
number
Scale differs by path (cosine / ts_rank / RRF / sigmoid). Do not compare across requests.
string
Next page (hybrid mode does not paginate — raise top_k).
string
Human-readable suggestion when results are empty. Pass it back to the model.
Notes
Rate limit: 5 QPS/user.Authorizations
Send Authorization: sk-mai-...
Body
application/json
Target collection (fixes vector model + data scope).
Non-empty search targets.
Available options:
caption, transcription, summary, title, frame_embedding, event Natural-language query (non-English is auto-translated). One of query / query_images required.
1–10 http(s) image URLs; averaged with query when both given.
Advanced: bring-your-own vector; must be 3072-dim (OmniRetriever).
semantic (default) | keyword | hybrid.
Available options:
semantic, keyword, hybrid Page size, default 20, max 200.
Next-page cursor; all other fields must match the first page exactly.
Filter DSL (and/or/not + leaves: video_ids, tags, time, captured_at, location, speaker_id, event_type).
Cross-encoder rerank of the current page (text query only). Billed ×3 when actually run.
moment (default) | video.
Available options:
moment, video Response
200 - application/json
Success
