YouTube Transcript
curl --request POST \
--url https://api-lr.agent.ai/v1/action/get_youtube_transcript \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://youtube.com/watch?v=example"
}
'import requests
url = "https://api-lr.agent.ai/v1/action/get_youtube_transcript"
payload = { "url": "https://youtube.com/watch?v=example" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://youtube.com/watch?v=example'})
};
fetch('https://api-lr.agent.ai/v1/action/get_youtube_transcript', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-lr.agent.ai/v1/action/get_youtube_transcript",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://youtube.com/watch?v=example'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-lr.agent.ai/v1/action/get_youtube_transcript"
payload := strings.NewReader("{\n \"url\": \"https://youtube.com/watch?v=example\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-lr.agent.ai/v1/action/get_youtube_transcript")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://youtube.com/watch?v=example\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-lr.agent.ai/v1/action/get_youtube_transcript")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://youtube.com/watch?v=example\"\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"metadata": {
"author": "Sequoia Capital",
"category": "People & Blogs",
"channel_id": "UCWrF0oN6unbXrWsTN7RctTw",
"channel_link": "http://www.youtube.com/@sequoiacapital",
"channel_name": "Sequoia Capital",
"description": "The landscape is wide open. The opportunity set is massive. At our second Sequoia Capital AI Ascent, Sonya Huang, Pat Grady, and Konstantine Buhler discuss the way AI is already providing glimpses of enduring value, and how this technology will help us do more with less so that we can solve more problems, create more, and build a better future.\n\n#AI #AIAscent #Sequoia #Startup #Founder #entrepreneur",
"id": "TDPqt7ONUCY",
"key_moments": [],
"length_seconds": 1616,
"likes": 1800,
"published_time": "Mar 26, 2024",
"thumbnail": "https://i.ytimg.com/vi_webp/TDPqt7ONUCY/maxresdefault.webp",
"title": "The AI opportunity: Sequoia Capital's AI Ascent 2024 opening remarks",
"views": 101403
},
"response": "The AI opportunity: Sequoia Capital's AI Ascent 2024 opening remarks\nmy name is pack Rady I'm one of the members..."
}{
"status": 400,
"response": null,
"error": "The requested page doesn't exist or there are no translations available for the video."
}Inputs & Data Retrieval
YouTube Transcript
Fetch the transcript of a specified YouTube video for review or further processing.
POST
/
action
/
get_youtube_transcript
YouTube Transcript
curl --request POST \
--url https://api-lr.agent.ai/v1/action/get_youtube_transcript \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://youtube.com/watch?v=example"
}
'import requests
url = "https://api-lr.agent.ai/v1/action/get_youtube_transcript"
payload = { "url": "https://youtube.com/watch?v=example" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({url: 'https://youtube.com/watch?v=example'})
};
fetch('https://api-lr.agent.ai/v1/action/get_youtube_transcript', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-lr.agent.ai/v1/action/get_youtube_transcript",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://youtube.com/watch?v=example'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-lr.agent.ai/v1/action/get_youtube_transcript"
payload := strings.NewReader("{\n \"url\": \"https://youtube.com/watch?v=example\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-lr.agent.ai/v1/action/get_youtube_transcript")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://youtube.com/watch?v=example\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-lr.agent.ai/v1/action/get_youtube_transcript")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://youtube.com/watch?v=example\"\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"metadata": {
"author": "Sequoia Capital",
"category": "People & Blogs",
"channel_id": "UCWrF0oN6unbXrWsTN7RctTw",
"channel_link": "http://www.youtube.com/@sequoiacapital",
"channel_name": "Sequoia Capital",
"description": "The landscape is wide open. The opportunity set is massive. At our second Sequoia Capital AI Ascent, Sonya Huang, Pat Grady, and Konstantine Buhler discuss the way AI is already providing glimpses of enduring value, and how this technology will help us do more with less so that we can solve more problems, create more, and build a better future.\n\n#AI #AIAscent #Sequoia #Startup #Founder #entrepreneur",
"id": "TDPqt7ONUCY",
"key_moments": [],
"length_seconds": 1616,
"likes": 1800,
"published_time": "Mar 26, 2024",
"thumbnail": "https://i.ytimg.com/vi_webp/TDPqt7ONUCY/maxresdefault.webp",
"title": "The AI opportunity: Sequoia Capital's AI Ascent 2024 opening remarks",
"views": 101403
},
"response": "The AI opportunity: Sequoia Capital's AI Ascent 2024 opening remarks\nmy name is pack Rady I'm one of the members..."
}{
"status": 400,
"response": null,
"error": "The requested page doesn't exist or there are no translations available for the video."
}Authorizations
Bearer token from your account (https://agent.ai/user/integrations#api)
Body
application/json
URL of the YouTube video.
Example:
"https://youtube.com/watch?v=example"
⌘I

