import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
page = client.streaming.playlists.list()
page = page.items[0]
print(page.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
"github.com/G-Core/gcore-go/streaming"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.Streaming.Playlists.List(context.TODO(), streaming.PlaylistListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
curl --request GET \
--url https://api.gcore.com/streaming/playlists \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/streaming/playlists', 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/playlists",
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/playlists")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/streaming/playlists")
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[
{
"name": "Playlist - playlist2",
"active": true,
"start_time": "2024-06-17T11:56:00.000Z",
"loop": true,
"video_ids": [
5528796,
5268174,
5065017
],
"client_user_id": null,
"countdown": false,
"playlist_type": "live",
"id": 10050,
"client_id": 102748,
"ad_id": null,
"player_id": null,
"hls_cmaf_url": "https://102748.gvideo.io/playlists/102748_10050/master-cmaf.m3u8",
"iframe_embed_code": "<iframe width=\"560\" height=\"315\" src=\"https://player.gvideo.co/playlists/102748_10050\" frameborder=\"0\" allowfullscreen></iframe>",
"iframe_url": "https://player.gvideo.co/playlists/102748_10050",
"hls_url": "https://102748.gvideo.io/playlists/102748_10050/master.m3u8"
}
]Get all playlists
Returns a list of created playlists
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
page = client.streaming.playlists.list()
page = page.items[0]
print(page.id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
"github.com/G-Core/gcore-go/streaming"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.Streaming.Playlists.List(context.TODO(), streaming.PlaylistListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
curl --request GET \
--url https://api.gcore.com/streaming/playlists \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/streaming/playlists', 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/playlists",
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/playlists")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/streaming/playlists")
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[
{
"name": "Playlist - playlist2",
"active": true,
"start_time": "2024-06-17T11:56:00.000Z",
"loop": true,
"video_ids": [
5528796,
5268174,
5065017
],
"client_user_id": null,
"countdown": false,
"playlist_type": "live",
"id": 10050,
"client_id": 102748,
"ad_id": null,
"player_id": null,
"hls_cmaf_url": "https://102748.gvideo.io/playlists/102748_10050/master-cmaf.m3u8",
"iframe_embed_code": "<iframe width=\"560\" height=\"315\" src=\"https://player.gvideo.co/playlists/102748_10050\" frameborder=\"0\" allowfullscreen></iframe>",
"iframe_url": "https://player.gvideo.co/playlists/102748_10050",
"hls_url": "https://102748.gvideo.io/playlists/102748_10050/master.m3u8"
}
]Authorizations
Response
Successful
A URL to a master playlist HLS (master.m3u8) with MPEG TS container.
This URL is a link to the main manifest. But you can also manually specify suffix-options that will allow you to change the manifest to your request:
/playlists/{client_id}_{playlist_id}/master[-cmaf][-min-N][-max-N][-img][-(h264|hevc|av1)].m3u8
Please see the details in hls_url attribute of /videos/{id} method.
Caution. Solely master.m3u8 (and master[-options].m3u8) is officially documented and intended for your use. Any additional internal manifests, sub-manifests, parameters, chunk names, file extensions, and related components are internal infrastructure entities. These may undergo modifications without prior notice, in any manner or form. It is strongly advised not to store them in your database or cache them on your end.
A URL to a master playlist HLS (master-cmaf.m3u8) with CMAF-based chunks. Chunks are in fMP4 container.
It is possible to use the same suffix-options as described in the "hls_url" attribute.
Caution. Solely master.m3u8 (and master[-options].m3u8) is officially documented and intended for your use. Any additional internal manifests, sub-manifests, parameters, chunk names, file extensions, and related components are internal infrastructure entities. These may undergo modifications without prior notice, in any manner or form. It is strongly advised not to store them in your database or cache them on your end.
A URL to a built-in HTML video player with the video inside. It can be inserted into an iframe on your website and the video will automatically play in all browsers.
The player can be opened or shared via this direct link. Also the video player can be integrated into your web pages using the Iframe tag.
Please see the details in iframe_url attribute of /videos/{id} method.
Was this page helpful?