> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://fastpix.com/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://fastpix.com/docs/_mcp/server.

# Get stream by ID

GET https://api.fastpix.com/v1/live/streams/{streamId}

This endpoint retrieves details about a specific live stream by its unique `streamId`. It includes data such as the stream’s `status` (idle, preparing, active, disabled), `metadata` (title, description), and more.

#### Example

Suppose a news agency is broadcasting a live event and wants to track the configurations set for the live stream while also checking the stream's status.

Related guide: Manage streams

Reference: https://fastpix.com/docs/live-stream-api/manage-live-stream/get-live-stream-by-id

## Authentication

- `Authorization` header (basic auth, required) — FastPix APIs are secured with Basic Authentication. Use your Access Token ID as the username and Secret Key as the password in the Authorization header of each API request. * Username: Access Token ID * Password: Secret Key Activate your FastPix account to generate your API credentials. See the guide here

## Request

### Path parameters

- `streamId` (string, required) — Upon creating a new live stream, FastPix assigns a unique identifier to the stream.

## Response

### 200

Stream details retrieved successfully

- `success` (boolean, optional) — Shows the request status. Returns true for success and false for failure.
- `data` (getCreateLiveStreamResponseDTO, optional) — Displays the result of the request.

## Types

### getCreateLiveStreamResponseDTO

Displays the result of the request.

- `streamId` (string, optional) — Upon creating a new live stream, FastPix assigns a unique identifier to the stream.
- `streamKey` (string, optional) — A unique stream key is generated for streaming, allowing the user to start streaming on any third-party platform using this key.
- `srtSecret` (string, optional) — A secret used for securing the SRT stream. This ensures that only authorized users can access the stream.
- `trial` (boolean, optional) — FastPix allows for a to trial the live stream for free. The duration of trial streams is five minutes. After five minutes of activity, the trial stream is turned off, and the recorded asset is removed after a day.
- `status` (string, optional) — The current live stream status can be one of four values:Idle, Preparing, Active or Disabled.The Idle status signifies that there isn"t a broadcast in progress.The preparing status indicates that the stream is getting prepared. while, the Active status indicates that a broadcast is currently in progress. The Disabled status means that no more RTMPS streams can be published.
- `maxResolution` (string, optional) — Max resolution can be used to control the maximum resolution your media is encoded, stored, and streamed at.
- `maxDuration` (integer, optional) — The maximum duration in seconds that a live stream can have before it ends the stream.
- `createdAt` (datetime, optional) — It is the moment when the stream was created Time the media was generated, defined as a localDateTime (UTC Time).
- `reconnectWindow` (integer, optional, default: 60) — In case the software streaming the live, gets disrupted for any reason and gets disconnected from FastPix, the reconnect window specifies the time span FastPix will wait before ending the stream. Before starting the stream, you can set the reconnect window time which is up to 1800 seconds.
- `enableRecording` (boolean, optional) — When set to true, FastPix records and stores the livestream for on-demand viewing. When set to false, the livestream is not recorded.
- `enableDvrMode` (boolean, optional) — Enables DVR (Digital Video Recorder) functionality for the live stream. When set to true, viewers can pause, rewind, and resume playback during the live broadcast. This allows time-shifted viewing of the stream while it is still ongoing.
- `mediaPolicy` (string, optional) — Determines whether the recorded stream must be publicly accessible or private in Live to VOD (Video on Demand).
- `metadata` (map from string to string, optional) — You can search for videos with specific key value pairs using metadata, when you tag a video in "key":"value"s pairs. Dynamic metadata allows you to define a key that allows any value pair. You can have maximum of 255 characters and upto 10 entries are allowed.
- `lowLatency` (boolean, optional) — Enables low-latency streaming mode to reduce playback delay.
- `closedCaptions` (boolean, optional) — when provided true Enables closed captions for the livestream.
- `playbackIds` (list of PlaybackIdResponse, optional) — A collection of Playback ID objects utilized for crafting HLS playback urls.
- `simulcastResponses` (list of liveSimulcast, optional) — A list of simulcast responses created for the livestream.
- `mediaIds` (list of string, optional) — A list of media IDs created when recording is enabled. Each media ID represents a recorded video (Live to VOD). If the stream is stopped and started again outside the reconnect window, a new media ID is generated for each session.
- `srtPlaybackResponse` (SrtPlaybackResponse, optional) — This object contains the livestream playback response details for SRT Protocol

### PlaybackIdResponse

A collection of Playback ID objects utilized for crafting HLS playback urls.

- `id` (string, optional) — Unique identifier for the playbackId
- `accessPolicy` (string, optional) — Determines if access to the streamed content is kept private or available to all.
- `accessRestrictions` (PlaybackIdResponseAccessRestrictions, optional) — Controls access based on domains and user agents. Defines a default policy (either "allow" or "deny") and provides lists for explicitly allowed or denied domains and user agents.

### liveSimulcast

- `simulcastId` (string, optional) — When you create the new simulcast, FastPix assign a universal unique identifier which can contain a maximum of 255 characters.
- `url` (string, optional) — The RTMPS hostname, combined with the application name, is crucial for connecting to third-party live streaming services and transmitting the live stream.
- `streamKey` (string, optional) — A unique stream key is generated for streaming, allowing the user to start streaming on any third-party platform using this key.
- `isEnabled` (boolean, optional) — When the value is true, the simulcast must be enabled for the given stream
- `metadata` (map from string to string, optional) — You can search for videos with specific key value pairs using metadata, when you tag a video in "key":"value"s pairs. Dynamic metadata allows you to define a key that allows any value pair. You can have maximum of 255 characters and upto 10 entries are allowed.

### SrtPlaybackResponse

This object contains the livestream playback response details for SRT Protocol

- `srtPlaybackStreamId` (string, optional) — A unique identifier for the SRT playback stream. This ID is used to distinguish between different playback streams
- `srtPlaybackSecret` (string, optional) — A playback secret used for securing the SRT playback stream. This ensures that only authorized users can access the playback

### PlaybackIdResponseAccessRestrictions

Controls access based on domains and user agents. Defines a default policy (either "allow" or "deny") and provides lists for explicitly allowed or denied domains and user agents.

- `domains` (PlaybackIdResponseAccessRestrictionsDomains, optional) — Restrictions based on the originating domain of a request (for example, whether requests from certain websites are allowed or blocked).
- `userAgents` (PlaybackIdResponseAccessRestrictionsUserAgents, optional) — Restrictions based on the user agent (typically a string sent by browsers or bots identifying themselves).

### PlaybackIdResponseAccessRestrictionsDomains

Restrictions based on the originating domain of a request (for example, whether requests from certain websites are allowed or blocked).

- `defaultPolicy` (enum, optional) — Policy action type
  - Allowed values: `allow`, `deny`
- `allow` (list of string, optional) — A list of domains that are explicitly allowed access. Only effective when defaultPolicy is "deny".
- `deny` (list of string, optional) — A list of domains that are explicitly blocked from accessing the resource. Only effective when defaultPolicy is "allow".

### PlaybackIdResponseAccessRestrictionsUserAgents

Restrictions based on the user agent (typically a string sent by browsers or bots identifying themselves).

- `defaultPolicy` (enum, optional) — Policy action type
  - Allowed values: `allow`, `deny`
- `allow` (list of string, optional) — A list of specific user agents that are allowed to access the resource. Only effective when defaultPolicy is "deny".
- `deny` (list of string, optional) — A list of specific user agents that are blocked. Only effective when defaultPolicy is "allow".

## Examples

**Response**

```json
{
  "success": true,
  "data": {
    "streamId": "fa7f8c0950ea48ebcc5ef9de8c23deaa",
    "streamKey": "3dc5d7641f918baa083a5c52a5bd9cbckfa7f8c0950ea48ebcc5ef9de8c23deaa",
    "srtSecret": "c51739512d0088d98a46925c9b74c73akfa7f8c0950ea48ebcc5ef9de8c23deaa",
    "trial": false,
    "status": "idle",
    "maxResolution": "1080p",
    "maxDuration": 28800,
    "createdAt": "2024-10-15T08:48:31.551351Z",
    "reconnectWindow": 60,
    "enableRecording": true,
    "enableDvrMode": false,
    "mediaPolicy": "public",
    "metadata": {
      "livestream_name": "fastpix_livestream"
    },
    "lowLatency": true,
    "closedCaptions": false,
    "playbackIds": [
      {
        "id": "4e43ec52-4775-4f68-a3ff-a57d8a59bba8",
        "accessPolicy": "public",
        "accessRestrictions": {
          "domains": {
            "defaultPolicy": "allow",
            "allow": [],
            "deny": []
          },
          "userAgents": {
            "defaultPolicy": "allow",
            "allow": [],
            "deny": []
          }
        }
      }
    ],
    "mediaIds": [
      "03cdf35d-8626-4b5f-bd14-d2212cd2a991"
    ],
    "srtPlaybackResponse": {
      "srtPlaybackStreamId": "playfa7f8c0950ea48ebcc5ef9de8c23deaa",
      "srtPlaybackSecret": "490e707dd4d165c9e38d261b252f9457kfa7f8c0950ea48ebcc5ef9de8c23deaa"
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.fastpix.com/v1/live/streams/61a264dcc447b63da6fb79ef925cd76d"

response = requests.get(url, auth=("<username>", "<password>"))

print(response.json())
```

```javascript
const url = 'https://api.fastpix.com/v1/live/streams/61a264dcc447b63da6fb79ef925cd76d';
const credentials = btoa("<username>:<password>");

const options = {method: 'GET', headers: {Authorization: `Basic ${credentials}`}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.fastpix.com/v1/live/streams/61a264dcc447b63da6fb79ef925cd76d"

	req, _ := http.NewRequest("GET", url, nil)

	req.SetBasicAuth("<username>", "<password>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.fastpix.com/v1/live/streams/61a264dcc447b63da6fb79ef925cd76d")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request.basic_auth("<username>", "<password>")

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.fastpix.com/v1/live/streams/61a264dcc447b63da6fb79ef925cd76d")
  .basicAuth("<username>", "<password>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.fastpix.com/v1/live/streams/61a264dcc447b63da6fb79ef925cd76d', [
  'headers' => [
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://api.fastpix.com/v1/live/streams/61a264dcc447b63da6fb79ef925cd76d");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.GET);

IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = ["Authorization": "Basic \(credentials)"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.fastpix.com/v1/live/streams/61a264dcc447b63da6fb79ef925cd76d")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```