Python
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
subtitles = client.streaming.videos.subtitles.list(
0,
)
print(subtitles)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
subtitles, err := client.Streaming.Videos.Subtitles.List(context.TODO(), 0)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", subtitles)
}
curl --request GET \
--url https://api.gcore.com/streaming/videos/{video_id}/subtitles \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/streaming/videos/{video_id}/subtitles', 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.gcore.com/streaming/videos/{video_id}/subtitles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/streaming/videos/{video_id}/subtitles")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/streaming/videos/{video_id}/subtitles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": 1000,
"name": "German (AI-generated)",
"language": "ger",
"vtt": "WEBVTT\n\n1\n00:00:07.154 --> 00:00:12.736\nWir haben 100 Millionen registrierte Benutzer oder aktive Benutzer, die mindestens einmal pro Woche spielen.\n\n2\n00:00:13.236 --> 00:00:20.198\nWir haben vielleicht 80 oder 100.000, die auf einem bestimmten Cluster spielen."
}
]{
"status": 400,
"error": "Bad Request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (for example, malformed request syntax, invalid request message framing, or deceptive request routing)."
}{
"status": 404,
"error": "Not Found. Entity you are looking for was not found, please check the initial parameters"
}Subtitles
Get all subtitles
Method returns a list of all subtitles that are already attached to a video.
GET
/
streaming
/
videos
/
{video_id}
/
subtitles
Python
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
subtitles = client.streaming.videos.subtitles.list(
0,
)
print(subtitles)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
subtitles, err := client.Streaming.Videos.Subtitles.List(context.TODO(), 0)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", subtitles)
}
curl --request GET \
--url https://api.gcore.com/streaming/videos/{video_id}/subtitles \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/streaming/videos/{video_id}/subtitles', 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.gcore.com/streaming/videos/{video_id}/subtitles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/streaming/videos/{video_id}/subtitles")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/streaming/videos/{video_id}/subtitles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": 1000,
"name": "German (AI-generated)",
"language": "ger",
"vtt": "WEBVTT\n\n1\n00:00:07.154 --> 00:00:12.736\nWir haben 100 Millionen registrierte Benutzer oder aktive Benutzer, die mindestens einmal pro Woche spielen.\n\n2\n00:00:13.236 --> 00:00:20.198\nWir haben vielleicht 80 oder 100.000, die auf einem bestimmten Cluster spielen."
}
]{
"status": 400,
"error": "Bad Request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (for example, malformed request syntax, invalid request message framing, or deceptive request routing)."
}{
"status": 404,
"error": "Not Found. Entity you are looking for was not found, please check the initial parameters"
}Authorizations
API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234$abcdef
Path Parameters
ID of the video
Was this page helpful?
⌘I