Documentation Index
Fetch the complete documentation index at: https://api-tools.memories.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Search Clips by Image API lets you upload a query image together with a natural-language prompt and finds the time ranges (clips) within a single specified video that best match both. The prompt lets you steer the visual search toward particular attributes (e.g. “focus on the red shirt”, “ignore the background”).
Prerequisites
- You’re familiar with the concepts described on the Platform overview.
- You have created a memories.ai API key.
- The target video has been uploaded to memories.ai and is currently in
PARSE status.
Host URL
Endpoint
POST /serve/api/v1/search_clips_by_image
/serve/api/v1/search_clips_by_image
Authentication
Pass your API key in the Authorization request header. Requests without a valid API key are rejected.
Content Type
The endpoint expects multipart/form-data. The file part carries the query image; other parameters are sent as form fields.
Request Example
import requests
url = "https://api.memories.ai/serve/api/v1/search_clips_by_image"
payload = {
"video_no": "VI625239098370850816",
"prompt": "focus on the red shirt, ignore background color",
"unique_id": "default"
}
files = [
("file", ("query.png", open("/path/to/query.png", "rb"), "image/png"))
]
headers = {"Authorization": "<API_KEY>"}
response = requests.post(url, headers=headers, data=payload, files=files)
print(response.json())
Request Parameters
Query image. Must not be empty. Allowed extensions: .jpg, .jpeg, .png, .gif, .bmp, .webp (case-insensitive). Content-Type must start with image/. Maximum size 20 MB.
Unique identifier of the video to search within (e.g. VI625239098370850816). Must be non-empty.
Natural-language prompt that refines the visual match (e.g. “focus on the red shirt”). Required — the server rejects the request with “The prompt parameter cannot be empty!” when absent. Use English for best results.
Scope identifier for the authenticated account.
Notes & Limits
- Rate limiting: The endpoint is protected by a per-account rate limit. Exceeding the limit returns an error indicating the request has exceeded the limit.
- Billing: This endpoint is metered — each successful call deducts points from your account balance.
- File validation: A request whose
file fails any check (empty, unsupported type/extension, > 20 MB) is rejected immediately with an error identifying the offending filename.
- Scope: Searching is restricted to the single video identified by
video_no; this endpoint does not search across a library.
Response Example
{
"code": "0000",
"msg": "success",
"data": [
{
"start_time": 12.5,
"end_time": 18.2,
"score": 0.8631
},
{
"start_time": 42.0,
"end_time": 47.8,
"score": 0.8124
}
],
"success": true,
"failed": false
}
Response Fields
Business status code. 0000 indicates success.
Human-readable status message.
Clip start time, in seconds.
Clip end time, in seconds.
Similarity / relevance score of the matched clip.
Query image. Allowed extensions: .jpg/.jpeg/.png/.gif/.bmp/.webp. Content-Type must start with image/. Max 20 MB.
Unique identifier of the video to search within. Must be non-empty.
Natural-language prompt that refines the visual match. Must be non-empty. English recommended.
Example:"focus on the red shirt, ignore background color"
Scope identifier for the authenticated account.