POST
/
youtube
/
video
/
transcript
YouTube Video Transcript
curl --request POST \
  --url https://mavi-backend.memories.ai/serve/api/v2/youtube/video/transcript \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "video_url": "https://www.youtube.com/watch?v=Y2y4OpzKIK4",
  "channel": "apify"
}
'
{
  "code": "0000",
  "msg": "success",
  "data": [
    {
      "data": [
        {
          "start": "1.480",
          "dur": "4.839",
          "text": "they've intercepted a croc from the"
        },
        {
          "start": "3.360",
          "dur": "5.720",
          "text": "jungle up for sale this is a a young"
        },
        {
          "start": "6.319",
          "dur": "5.081",
          "text": "female that was taken from a wildlife"
        },
        {
          "start": "9.080",
          "dur": "4.439",
          "text": "Trader okay obviously uh trying to make"
        },
        {
          "start": "11.400",
          "dur": "4.680",
          "text": "a dollar so what we want to do is catch"
        }
      ]
    }
  ],
  "failed": false,
  "success": true
}
This endpoint allows you to retrieve transcript for a YouTube video.

Code Example

import requests

BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2"
API_KEY = "sk-8483027fe3abfe535f6ae01a9979b4f7"
HEADERS = {
    "Authorization": f"{API_KEY}"
}

def youtube_video_transcript(video_url: str, channel: str):
    url = f"{BASE_URL}/youtube/video/transcript"
    data = {"video_url": video_url, "channel": channel}
    resp = requests.post(url, headers=HEADERS, json=data)
    return resp.json()

# Usage example
result = youtube_video_transcript("https://www.youtube.com/watch?v=Y2y4OpzKIK4", "apify")
print(result)

Request Body

FieldTypeRequiredDescription
video_urlstringYesThe YouTube video URL
channelstringYesThe channel name. Supported values: apify, rapid, memories.ai

Response

Returns the video transcript.
{
  "code": "0000",
  "msg": "success",
  "data": [
    {
      "data": [
        {
          "start": "1.480",
          "dur": "4.839",
          "text": "they've intercepted a croc from the"
        },
        {
          "start": "3.360",
          "dur": "5.720",
          "text": "jungle up for sale this is a a young"
        },
        {
          "start": "6.319",
          "dur": "5.081",
          "text": "female that was taken from a wildlife"
        },
        {
          "start": "9.080",
          "dur": "4.439",
          "text": "Trader okay obviously uh trying to make"
        },
        {
          "start": "11.400",
          "dur": "4.680",
          "text": "a dollar so what we want to do is catch"
        }
      ]
    }
  ],
  "failed": false,
  "success": true
}

Response Parameters

ParameterTypeDescription
codestringResponse code indicating the result status
msgstringResponse message describing the operation result
dataarray[object]Array containing transcript data objects
data[].dataarray[object]Array of transcript segments
data[].data[].startstringStart time of the transcript segment in seconds
data[].data[].durstringDuration of the transcript segment in seconds
data[].data[].textstringThe transcript text for this segment
successbooleanIndicates whether the operation was successful
failedbooleanIndicates whether the operation failed

Authorizations

Authorization
string
header
required

Body

application/json
video_url
string
required

The YouTube video URL

Example:

"https://www.youtube.com/watch?v=Y2y4OpzKIK4"

channel
enum<string>
required

The channel name. Supported values: apify, rapid, memories.ai

Available options:
apify,
rapid,
memories.ai
Example:

"apify"

Response

200 - application/json

Video transcript

code
string

Response code indicating the result status

Example:

"0000"

msg
string

Response message describing the operation result

Example:

"success"

data
object[]

Array containing transcript data objects

success
boolean

Indicates whether the operation was successful

Example:

true

failed
boolean

Indicates whether the operation failed

Example:

false