Skip to main content
POST
/
serve
/
api
/
v1
/
search
Search from Private Library
curl --request POST \
  --url https://api.memories.ai/serve/api/v1/search \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "search_param": "boat in the ocean",
  "search_type": "BY_VIDEO",
  "unique_id": "default",
  "top_k": 3,
  "filtering_level": "medium",
  "video_nos": [
    "VI635764894954369024"
  ],
  "tag": "test1",
  "latitude": "88.88",
  "longitude": "88.88"
}
'
{
  "code": "0000",
  "msg": "success",
  "data": {},
  "success": true,
  "failed": false
}

Prerequisites

  • You have created a memories.ai API key.
  • At least one video/image has been uploaded to memories.ai and is currently in PARSE status.

Host URL

https://api.memories.ai

Endpoint

POST /serve/api/v1/search
/serve/api/v1/search

Request Example

Python

import requests

headers = {"Authorization": "<API_KEY>"} # API key

json_body = { 
    "search_param": "<YOUR_PROMPT>", # The search query 
    "search_type": "BY_VIDEO", # 'BY_AUDIO' or 'BY_VIDEO' or 'BY_IMAGE' 
    "unique_id": "1", # optional 
    "top_k": 3, # optional 
    "filtering_level": "high", # low/medium/high 
    "video_nos": ['VI635764894954369024'] # Optional
}

response = requests.post( 
    "https://api.memories.ai/serve/api/v1/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.

Request Body

{ 
    "search_param": "boat in the ocean", 
    "search_type": "BY_VIDEO", 
    "unique_id": "1", 
    "top_k": 3, 
    "filtering_level": "medium", 
    "tag": "test1", 
    "latitude": "88.88", 
    "longitude": "88.88",
}

Request Parameters

search_type
string
required
One of: BY_VIDEO, BY_AUDIO, BY_IMAGE.
unique_id
string
default:"default"
Unique ID for scope.
filtering_level
string
low, medium, or high.

Response Example

Video Search (BY_VIDEO/BY_AUDIO)

{ 
    "code": "0000", 
    "msg": "success", 
    "data": [ 
        { 
            "videoNo": "VI576925607808602112", 
            "videoName": "1920447021987282945", 
            "startTime": "13", 
            "endTime": "18", 
            "score": 0.5221236659362116 
        } 
    ]
}

Image Search (BY_IMAGE)

{ 
    "code": "0000", 
    "msg": "success", 
    "data": { 
        "item": [ 
            { 
                "latitude": 39.9042, 
                "longitude": 116.4074, 
                "id": "619915496901337088", 
                "name": "OIX_ZOOM", 
                "img_url": "https://storage.googleapis.com/.../OIX_ZOOM.jpg?...", 
                "datetime_taken": "1757285520000", 
                "camera_model": "Canon EOS 5D" 
            }, 
            { 
                "latitude": 39.9042, 
                "longitude": 116.4074, 
                "id": "619915496901337089", 
                "name": "youtube head", 
                "img_url": "https://storage.googleapis.com/.../youtube%20head.png?...", 
                "datetime_taken": "1757285520000", 
                "camera_model": "Canon EOS 5D" 
            } 
        ], 
        "current_page": 0, 
        "page_size": 20, 
        "total_count": "5" 
    }
}

Response Structure (Video Search: BY_VIDEO/BY_AUDIO)

(Details on response fields)

Response Structure (Image Search: BY_IMAGE)

(Details on response fields)

Best Practices

  • Use top_k: Limit results to the most relevant items for efficiency.
  • Filter tuning: Adjust filtering_level to balance recall and precision (low = broad, high = strict).
  • Prompt clarity: Make search queries concise and descriptive for optimal ranking.

Authorizations

Authorization
string
header
required

Body

application/json
search_param
string
required
Example:

"boat in the ocean"

search_type
enum<string>
required
Available options:
BY_VIDEO,
BY_AUDIO,
BY_IMAGE
Example:

"BY_VIDEO"

unique_id
string
default:default
top_k
integer
default:3
filtering_level
enum<string>
Available options:
low,
medium,
high
Example:

"medium"

video_nos
string[]
Example:
["VI635764894954369024"]
tag
string
Example:

"test1"

latitude
string
Example:

"88.88"

longitude
string
Example:

"88.88"

Response

200 - application/json

Successful response

code
Example:

"0000"

msg
string
Example:

"success"

data
success
boolean
Example:

true

failed
boolean
Example:

false