Skip to main content
POST
/
serve
/
api
/
v1
/
search_public
Search from Public Video Sources
curl --request POST \
  --url https://api.memories.ai/serve/api/v1/search_public \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "search_param": "Find sprint race with Usain Bolt",
  "search_type": "BY_VIDEO",
  "type": "TIKTOK",
  "top_k": 3,
  "filtering_level": "medium"
}
'
{
  "code": "0000",
  "msg": "success",
  "data": {},
  "success": true,
  "failed": false
}

Prerequisites

  • You have created a memories.ai API key.

Host URL

https://api.memories.ai

Endpoint

POST /serve/api/v1/search_public
/serve/api/v1/search_public

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' 
    "type": "TIKTOK", # 'TIKTOK' by default, options: 'TIKTOK', 'YOUTUBE', 'INSTAGRAM' 
    "top_k": 3, 
    "filtering_level": "high" # low/medium/high
}

response = requests.post( 
    "https://api.memories.ai/serve/api/v1/search_public", 
    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": "Find sprint race with Usain Bolt", 
    "search_type": "BY_VIDEO", 
    "type": "TIKTOK", 
    "top_k": 3, 
    "filtering_level": "medium"
}

Request Parameters

search_type
string
required
One of: BY_VIDEO, BY_AUDIO.
type
string
default:"TIKTOK"
One of: TIKTOK, YOUTUBE, INSTAGRAM.
filtering_level
string
low, medium, or high.

Response Example

{ 
    "code": "0000", 
    "msg": "success", 
    "data": [ 
        { 
            "videoNo": "PI-600947902470296459", 
            "videoName": "They played in their OPPONENTS jerseys?!?", 
            "startTime": "23", 
            "endTime": "27", 
            "score": 0.7350679636001586 
        } 
    ]
}

Best Practices

  • Platform selection: Use the type parameter to specify the desired dataset (TikTok, YouTube, Instagram).
  • 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 queries concise and descriptive for optimal retrieval.

Authorizations

Authorization
string
header
required

Body

application/json
search_param
string
required
Example:

"Find sprint race with Usain Bolt"

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

"BY_VIDEO"

type
enum<string>
default:TIKTOK
Available options:
TIKTOK,
YOUTUBE,
INSTAGRAM
top_k
integer
default:3
filtering_level
enum<string>
Available options:
low,
medium,
high
Example:

"medium"

Response

200 - application/json

Successful response

code
Example:

"0000"

msg
string
Example:

"success"

data
success
boolean
Example:

true

failed
boolean
Example:

false