Create a live stream
Before you can start streaming, you need to create a stream
resource by calling the POST /streams
endpoint with your API Key.
Here is an example how to create the stream
resource from a shell using curl or directly from JavaScript:
API_KEY="your-api-key"
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: ${API_KEY}" \
-d '{}' \
https://api.comprimato.com/v1/streams
const API_KEY = 'your-api-key'
fetch(`https://api.comprimato.com/v1/streams`, {
headers: {
'Authorization:': `${API_KEY}`
}
})
.then(response => response.json())
.then(data => {
const { id, streamer_key, player_key } = data
console.log('ID:', id)
console.log('Stream Key:', streamer_key)
console.log('Player Key:', player_key)
})
You can find examples for other languages in the API documentation .
If the API key is valid, you will receive a response containing the id
, streamer_key
, and player_key
values:
-
The
id
is an unique identifier for thestream
resource when interacting with the REST API. For any operation on thestream
resource, you need to know itsid
. See API documentation. -
The
streamer_key
is used to authenticate input SRT streams. Anyone with a validstreamer_key
can stream to the Comprimato at any time. Astreamer_key
can be re-used to stream at multiple times, but onestreamer_key
cannot be used for multiple streams at the same time. In such situation, please create multiplestream
resources using the API. You can create as many of them as you want. See howstreamer_key
is used for configuring your streaming software. -
The
player_key
is used for playback of the final stream. Anyone with a validplayer_key
can view the stream. See howplayer_key
is used to Play the Live Stream. -
status
indicates if the stream is currently running or stopped.
Example of a valid response:
{
"id": "0e00c4e5-3c2a-4e8d-9751-e3cab17f7043",
"streamer_key": "bec90e60-d3a1-4c7b-9530-7dca33f11b24",
"player_key": "lU1rTlq0mwc1",
"status": "Stopped"
}
Updated over 2 years ago
Once you have created the stream
resource, start the live streaming by setting up your streaming software.