import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
restream = client.streaming.restreams.get(
0,
)
print(restream.id)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"),
)
restream, err := client.Streaming.Restreams.Get(context.TODO(), 0)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", restream.ID)
}
curl --request GET \
--url https://api.gcore.com/streaming/restreams/{restream_id} \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/streaming/restreams/{restream_id}', 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/restreams/{restream_id}",
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/restreams/{restream_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/streaming/restreams/{restream_id}")
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": "Live Stream to Youtube 2024-06-21",
"active": true,
"uri": "rtmp://a.rtmp.youtube.com/live2/6w4g-9cw7-62dh-c6se-b4hq",
"stream_id": 1439046,
"client_user_id": 1000,
"source": "transcoded",
"no_audio": true,
"no_audio_mode": "silence",
"id": 287834,
"live": false,
"client_id": 102748,
"playlist_id": null,
"quality_id": null
}Get restream
Returns configuration and status details for a specific restream
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
restream = client.streaming.restreams.get(
0,
)
print(restream.id)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"),
)
restream, err := client.Streaming.Restreams.Get(context.TODO(), 0)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", restream.ID)
}
curl --request GET \
--url https://api.gcore.com/streaming/restreams/{restream_id} \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/streaming/restreams/{restream_id}', 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/restreams/{restream_id}",
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/restreams/{restream_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/streaming/restreams/{restream_id}")
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": "Live Stream to Youtube 2024-06-21",
"active": true,
"uri": "rtmp://a.rtmp.youtube.com/live2/6w4g-9cw7-62dh-c6se-b4hq",
"stream_id": 1439046,
"client_user_id": 1000,
"source": "transcoded",
"no_audio": true,
"no_audio_mode": "silence",
"id": 287834,
"live": false,
"client_id": 102748,
"playlist_id": null,
"quality_id": null
}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
Restream ID
Response
Successful
Restream name
Indicates that the stream is being published. Has two possible values:
- true — stream is being published
- false — stream isn't published
Enables/Disables restream. Has two possible values:
-
true — restream is enabled and can be started
-
false — restream is disabled.
Default is true
A URL to push the stream to. Supported protocols: rtmp, rtmps, srt. For SRT target URLs, only mode=caller is supported.
"srt://example.com:1234?mode=caller"
ID of the stream to restream
Custom field where you can specify user ID in your system
Removes the source audio track from the restream. Has two possible values:
- false – the source audio track is forwarded to the target as is (default)
- true – the audio track is removed or replaced, depending on
no_audio_mode
Useful to avoid copyright claims on platforms like YouTube when the source stream contains licensed music or other copyrighted audio.
Only strict boolean values (true/false) are accepted; any other value returns a 422 error.
Defines how the audio track is handled when no_audio is true. Ignored when no_audio is false.
Types:
- "drop" – removes the audio track entirely.
- "silence" – replaces the audio track with a silent track instead of removing it.
Note: YouTube rejects incoming streams with no audio track at all. Use
no_audio_mode=silencewhen restreaming to YouTube.
drop, silence Selects which version of the stream is used as the source for the restream.
Types:
- "original" – uses the original ingested stream without any modifications (default).
- "transcoded" – uses the transcoded output, including overlays. Use it when you want to restream the stream with enabled overlays.
Note: For
transcoded, the highest quality available in the stream's quality ladder is used. For example, if the ladder is 480p/720p/1080p, 1080p is used; if the ladder goes up to 4K, 4K is used.
original, transcoded Restream ID
Client ID
ID of the playlist used as source for the restream, if applicable
ID of the specific transcoded quality used as source for the restream, if applicable