Search Video
Using a natural language query, this API searches through all processed videos and ranks the video clips within milliseconds. Memories.ai retrieves and ranks videos based on visual information in a way similar to human perception. With this API, developers can access the most relevant videos from their entire library.
Searching from AUDIO
and VIDEO
are supported and the most relevant clips will be retrieved from the video.
Prerequisites
- You have created a memories.ai API key.
- At least one video has been uploaded to memories.ai and is currently in
PARSE
status.
Host URL
https://api.memories.ai
Endpoint
POST /serve/api/video/search
Request Example
import requests
headers = {"Authorization": "<API_KEY>"} # API key
json_body = {
"search_param": "<YOUR_PROMPT>", # The search query
"folder_id": -1, # By default -1.
"search_type": "BY_VIDEO" # 'BY_AUDIO' or 'BY_VIDEO' or 'BY_CLIP'
}
response = requests.post(
"https://api.memories.ai/serve/api/video/search",
headers=headers,
json=json_body
)
print(response.json())
Replace API_KEY
in the code above with your actual API key and YOUR_PROMPT
with your search query. You can search for relevant videos you've uploaded using natural language.
Request Body
{
"search_param": "Find sprint race with Usain Bolt",
"folder_id": -2
}
Request Parameters
Name | Location | Type | Required | Description |
---|---|---|---|---|
Authorization | header | string | Yes | API key used for authorization |
search_param | body | string | Yes | Natural language search query |
folder_id | body | int | No | -1 for Default folder; -2 for API folder; -1 by default |
search_type | body | string | Yes | BY_AUDIO search by audio; BY_VIDEO search by video and return video numbers; BY_CLIP search by video and return exact clips |
Response Example
Status code 200
{
"code": "SUCCESS",
"msg": "Search completed successfully",
"data": {
"videos": [
{
"videoNo": "mavi_video_001",
"videoName": "olympic_sprint.mp4",
"videoStatus": "PARSE",
"uploadTime": "1740995860114"
}
]
}
}
Response Result
Status code | Status code msg | Description | Data |
---|---|---|---|
200 | OK | Request was successful | Inline |
Response Structure
Status code 200
Name | Type | Required | Restriction | Description |
---|---|---|---|---|
code | string | true | none | response code |
msg | string | true | none | message with response code |
data | object | true | none | JSON data |
» videos | [object] | false | none | JSON data |
»» videoNo | string | true | none | video number |
»» videoName | string | false | none | video name |
»» videoStatus | string | false | none | video status |
»» uploadTime | string | false | none | upload timestamp(ms) |